diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f49e51a92b4..4b5c6e4f530 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -14,6 +14,7 @@ "packages/google-cloud-bigquery-reservation": "2.0.4", "packages/google-cloud-certificatemanager": "0.6.2", "packages/google-cloud-contentwarehouse": "0.1.2", + "packages/google-cloud-datalabeling": "3.1.1", "packages/google-cloud-dataplex": "2.2.2", "packages/google-cloud-dataproc": "4.1.1", "packages/google-cloud-deploy": "2.2.2", diff --git a/packages/google-cloud-datalabeling/.OwlBot.yaml b/packages/google-cloud-datalabeling/.OwlBot.yaml new file mode 100644 index 00000000000..5383934f13a --- /dev/null +++ b/packages/google-cloud-datalabeling/.OwlBot.yaml @@ -0,0 +1,21 @@ +# 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/datalabeling/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-datalabeling/$1 + diff --git a/packages/google-cloud-datalabeling/.eslintignore b/packages/google-cloud-datalabeling/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-datalabeling/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-datalabeling/.eslintrc.json b/packages/google-cloud-datalabeling/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-datalabeling/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-datalabeling/.gitattributes b/packages/google-cloud-datalabeling/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-datalabeling/.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-datalabeling/.gitignore b/packages/google-cloud-datalabeling/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-datalabeling/.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-datalabeling/.jsdoc.js b/packages/google-cloud-datalabeling/.jsdoc.js new file mode 100644 index 00000000000..507b1065d1f --- /dev/null +++ b/packages/google-cloud-datalabeling/.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/datalabeling', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-datalabeling/.mocharc.js b/packages/google-cloud-datalabeling/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-datalabeling/.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-datalabeling/.mocharc.json b/packages/google-cloud-datalabeling/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-datalabeling/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-datalabeling/.nycrc b/packages/google-cloud-datalabeling/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-datalabeling/.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-datalabeling/.prettierignore b/packages/google-cloud-datalabeling/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-datalabeling/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-datalabeling/.prettierrc.js b/packages/google-cloud-datalabeling/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-datalabeling/.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-datalabeling/.repo-metadata.json b/packages/google-cloud-datalabeling/.repo-metadata.json new file mode 100644 index 00000000000..d446de958e7 --- /dev/null +++ b/packages/google-cloud-datalabeling/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "default_version": "v1beta1", + "release_level": "preview", + "requires_billing": true, + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/datalabeling/latest", + "codeowner_team": "@googleapis/ml-apis", + "language": "nodejs", + "issue_tracker": "", + "product_documentation": "https://cloud.google.com/data-labeling/docs/", + "name": "datalabeling", + "distribution_name": "@google-cloud/datalabeling", + "name_pretty": "Google Cloud Data Labeling", + "api_id": "datalabeling.googleapis.com", + "repo": "googleapis/google-cloud-node", + "api_shortname": "datalabeling", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-datalabeling/CHANGELOG.md b/packages/google-cloud-datalabeling/CHANGELOG.md new file mode 100644 index 00000000000..bf54f8d32f0 --- /dev/null +++ b/packages/google-cloud-datalabeling/CHANGELOG.md @@ -0,0 +1,300 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/datalabeling?activeTab=versions + +## [3.1.1](https://github.com/googleapis/nodejs-datalabeling/compare/v3.1.0...v3.1.1) (2022-11-11) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#373](https://github.com/googleapis/nodejs-datalabeling/issues/373)) ([79cdd8f](https://github.com/googleapis/nodejs-datalabeling/commit/79cdd8f9034fbd65f1db9b50a33116929d529736)) +* Better support for fallback mode ([#369](https://github.com/googleapis/nodejs-datalabeling/issues/369)) ([bc2cf61](https://github.com/googleapis/nodejs-datalabeling/commit/bc2cf61fefcd03248a8b1eae492729edc677555a)) +* Change import long to require ([#370](https://github.com/googleapis/nodejs-datalabeling/issues/370)) ([7e53220](https://github.com/googleapis/nodejs-datalabeling/commit/7e53220e039ef6ec12a96dfbacd539cbc4948288)) +* **deps:** Do not depend on protobufjs ([#365](https://github.com/googleapis/nodejs-datalabeling/issues/365)) ([68c3205](https://github.com/googleapis/nodejs-datalabeling/commit/68c320583fcd4157a2a95aa01c431bf2193d0182)) +* **deps:** Use google-gax v3.5.2 ([#379](https://github.com/googleapis/nodejs-datalabeling/issues/379)) ([67a6af6](https://github.com/googleapis/nodejs-datalabeling/commit/67a6af631dcb9919eaa58ccbc2d19f359489f277)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-datalabeling/issues/1553)) ([#372](https://github.com/googleapis/nodejs-datalabeling/issues/372)) ([7740922](https://github.com/googleapis/nodejs-datalabeling/commit/77409220eba817c81a7b87fd535e839a75bcb7d3)) +* Preserve default values in x-goog-request-params header ([#374](https://github.com/googleapis/nodejs-datalabeling/issues/374)) ([c2df026](https://github.com/googleapis/nodejs-datalabeling/commit/c2df0262f6135946f0bf81ad89748e80079321c3)) +* Regenerated protos JS and TS definitions ([#382](https://github.com/googleapis/nodejs-datalabeling/issues/382)) ([91598fc](https://github.com/googleapis/nodejs-datalabeling/commit/91598fce400d2f9a11b3780f81f8d30be101c864)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-datalabeling/issues/1546)) ([#371](https://github.com/googleapis/nodejs-datalabeling/issues/371)) ([d8844f2](https://github.com/googleapis/nodejs-datalabeling/commit/d8844f29ccfd352b98b91f3422d085934e722f76)) +* use google-gax v3.3.0 ([7740922](https://github.com/googleapis/nodejs-datalabeling/commit/77409220eba817c81a7b87fd535e839a75bcb7d3)) + +## [3.1.0](https://github.com/googleapis/nodejs-datalabeling/compare/v3.0.0...v3.1.0) (2022-07-05) + + +### Features + +* support regapic LRO ([aa77671](https://github.com/googleapis/nodejs-datalabeling/commit/aa77671435d69c4270af35f0d6e5f2be71f1b4b2)) + +## [3.0.0](https://github.com/googleapis/nodejs-datalabeling/compare/v2.3.0...v3.0.0) (2022-06-10) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#356) + +### Bug Fixes + +* **datalabeling:** add ancillary service bindings to service_yaml ([#331](https://github.com/googleapis/nodejs-datalabeling/issues/331)) ([1df9ca2](https://github.com/googleapis/nodejs-datalabeling/commit/1df9ca2c5f3bf0a5c937d5372d6ba1324536683f)) + + +### Build System + +* update library to use Node 12 ([#356](https://github.com/googleapis/nodejs-datalabeling/issues/356)) ([07afd31](https://github.com/googleapis/nodejs-datalabeling/commit/07afd3120b29225442eb9d38c3756de13766ae50)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.2.7...v2.3.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#307](https://www.github.com/googleapis/nodejs-datalabeling/issues/307)) ([adbe0cd](https://www.github.com/googleapis/nodejs-datalabeling/commit/adbe0cdef6538df9055a5e5039161e5a680cb336)) + +### [2.2.7](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.2.6...v2.2.7) (2021-08-17) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#304](https://www.github.com/googleapis/nodejs-datalabeling/issues/304)) ([8835988](https://www.github.com/googleapis/nodejs-datalabeling/commit/88359888f303d90d27b0449dd811e42dadebc5d2)) +* **deps:** google-gax v2.24.1 ([#306](https://www.github.com/googleapis/nodejs-datalabeling/issues/306)) ([ea18b87](https://www.github.com/googleapis/nodejs-datalabeling/commit/ea18b87feff1da34b57decb44fea83b3b371b162)) + +### [2.2.6](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.2.5...v2.2.6) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#296](https://www.github.com/googleapis/nodejs-datalabeling/issues/296)) ([b67af5c](https://www.github.com/googleapis/nodejs-datalabeling/commit/b67af5c6eea1142d6b1f08f7dd9213a7078a4d59)) + +### [2.2.5](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.2.4...v2.2.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#294](https://www.github.com/googleapis/nodejs-datalabeling/issues/294)) ([f2fc8c0](https://www.github.com/googleapis/nodejs-datalabeling/commit/f2fc8c06a8440311ddf9525c2c16c43c31ce1e7d)) + +### [2.2.4](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.2.3...v2.2.4) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#291](https://www.github.com/googleapis/nodejs-datalabeling/issues/291)) ([ba455a8](https://www.github.com/googleapis/nodejs-datalabeling/commit/ba455a8d574f9bb87c9f7531ba56e199ad0dc8be)) + +### [2.2.3](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.2.2...v2.2.3) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#287](https://www.github.com/googleapis/nodejs-datalabeling/issues/287)) ([2565d60](https://www.github.com/googleapis/nodejs-datalabeling/commit/2565d60b3e98946c216fe040c2e7eb42cee6019f)) + +### [2.2.2](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.2.1...v2.2.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#279](https://www.github.com/googleapis/nodejs-datalabeling/issues/279)) ([a78809f](https://www.github.com/googleapis/nodejs-datalabeling/commit/a78809f7a83fd774dad8599315938e1cdb6e438a)) + +### [2.2.1](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.2.0...v2.2.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#270](https://www.github.com/googleapis/nodejs-datalabeling/issues/270)) ([9f1d2fa](https://www.github.com/googleapis/nodejs-datalabeling/commit/9f1d2faacdbb3e9503b450b6c8da4d70bcd4d66f)) +* use require() to load JSON protos ([#273](https://www.github.com/googleapis/nodejs-datalabeling/issues/273)) ([4ba477e](https://www.github.com/googleapis/nodejs-datalabeling/commit/4ba477e2f408db02ed08cc4acfc02914273c5b92)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.1.2...v2.2.0) (2021-01-09) + + +### Features + +* introduces style enumeration ([#242](https://www.github.com/googleapis/nodejs-datalabeling/issues/242)) ([34bd1ec](https://www.github.com/googleapis/nodejs-datalabeling/commit/34bd1ec34d76976cbb96ee75892a62500dbd3cef)) + +### [2.1.2](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.1.1...v2.1.2) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([#236](https://www.github.com/googleapis/nodejs-datalabeling/issues/236)) ([a861cd0](https://www.github.com/googleapis/nodejs-datalabeling/commit/a861cd0671cb04baf0f2b40f376fcb974e4c7159)) +* do not modify options object, use defaultScopes ([#231](https://www.github.com/googleapis/nodejs-datalabeling/issues/231)) ([6bcb17b](https://www.github.com/googleapis/nodejs-datalabeling/commit/6bcb17b6cc40cbc2448e8722e8918324ae2261e4)) + +### [2.1.1](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.1.0...v2.1.1) (2020-07-10) + + +### Bug Fixes + +* typeo in nodejs .gitattribute ([#198](https://www.github.com/googleapis/nodejs-datalabeling/issues/198)) ([494d94c](https://www.github.com/googleapis/nodejs-datalabeling/commit/494d94c6baafe7626feb4eb611e09eb25f7936f2)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v2.0.0...v2.1.0) (2020-06-28) + + +### Features + +* move ts target to es2018 from es2016 ([#187](https://www.github.com/googleapis/nodejs-datalabeling/issues/187)) ([c221d20](https://www.github.com/googleapis/nodejs-datalabeling/commit/c221d20ca6db52d9c42940bd37efba8e04130fe2)) + + +### Bug Fixes + +* proper fallback option handling ([180d2e2](https://www.github.com/googleapis/nodejs-datalabeling/commit/180d2e2a9f5385e4befd1ebaa78fdac3237d6a71)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.6.0...v2.0.0) (2020-06-04) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* check status of long running operation by its name ([#180](https://www.github.com/googleapis/nodejs-datalabeling/issues/180)) ([914f99c](https://www.github.com/googleapis/nodejs-datalabeling/commit/914f99c2bbd4870ffbd7e4085dcd1e2d1284d77a)) +* drop node8 support, support for async iterators ([#161](https://www.github.com/googleapis/nodejs-datalabeling/issues/161)) ([8f6cfa8](https://www.github.com/googleapis/nodejs-datalabeling/commit/8f6cfa8bef7ac591d3432d5a6480305524bf96c9)) + + +### Bug Fixes + +* export explicit version from protos.js ([#166](https://www.github.com/googleapis/nodejs-datalabeling/issues/166)) ([7096188](https://www.github.com/googleapis/nodejs-datalabeling/commit/709618898603d50c8c92b01e8bb26a866ed47e3e)) +* remove eslint, update gax, fix generated protos, run the generator ([#170](https://www.github.com/googleapis/nodejs-datalabeling/issues/170)) ([35d38b2](https://www.github.com/googleapis/nodejs-datalabeling/commit/35d38b2cde5d19b4c00c88a4a3907e81997f6e35)) +* remove unused files from package ([#173](https://www.github.com/googleapis/nodejs-datalabeling/issues/173)) ([7d43739](https://www.github.com/googleapis/nodejs-datalabeling/commit/7d437395f993774eaab20bff1d58cda025e20a54)) +* synth.py clean up for multiple version ([#182](https://www.github.com/googleapis/nodejs-datalabeling/issues/182)) ([67f56a1](https://www.github.com/googleapis/nodejs-datalabeling/commit/67f56a18588c3e12615b6ad630b906d745ae6093)) + +## [1.6.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.5.0...v1.6.0) (2020-03-06) + + +### Features + +* deferred client initialization ([#146](https://www.github.com/googleapis/nodejs-datalabeling/issues/146)) ([cbd8224](https://www.github.com/googleapis/nodejs-datalabeling/commit/cbd82248f93360815e17dbf50098ad3a3ec6360a)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.4.2...v1.5.0) (2020-02-29) + + +### Features + +* export protos in src/index.ts ([42812db](https://www.github.com/googleapis/nodejs-datalabeling/commit/42812db5f9c56b744c32314aaf4e7c48c13a62b1)) + +### [1.4.2](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.4.1...v1.4.2) (2020-02-10) + + +### Bug Fixes + +* pass x-goog-request-params header for streaming calls ([e4e78e6](https://www.github.com/googleapis/nodejs-datalabeling/commit/e4e78e69090103a81bea41d6a48040e1803bd924)) + +### [1.4.1](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.4.0...v1.4.1) (2020-01-31) + + +### Bug Fixes + +* resource names helper functions; enum, bytes, and Long types now accept strings ([#117](https://www.github.com/googleapis/nodejs-datalabeling/issues/117)) ([e9793d6](https://www.github.com/googleapis/nodejs-datalabeling/commit/e9793d67bc76e781e8f52f700cf20915bac4c3b4)) +* update proto files ([3e53076](https://www.github.com/googleapis/nodejs-datalabeling/commit/3e530762affd4896b65921fe7a13717cb0fdcb0d)) +* updated proto files ([cc8f27d](https://www.github.com/googleapis/nodejs-datalabeling/commit/cc8f27d05c58a4cba2f5544fad07752f49ca56da)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.3.4...v1.4.0) (2020-01-17) + + +### Features + +* move to typescript code generation ([#109](https://www.github.com/googleapis/nodejs-datalabeling/issues/109)) ([381b1eb](https://www.github.com/googleapis/nodejs-datalabeling/commit/381b1eb70eef00ffd4292fbffbddf36d4e13bdec)) + +### [1.3.4](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.3.3...v1.3.4) (2019-12-05) + + +### Bug Fixes + +* import long type into proto ts declaration file ([#93](https://www.github.com/googleapis/nodejs-datalabeling/issues/93)) ([7b16da1](https://www.github.com/googleapis/nodejs-datalabeling/commit/7b16da1bc47cc0b235c7a6293ff393d9db2b7538)) +* **deps:** pin TypeScript below 3.7.0 ([6b91e93](https://www.github.com/googleapis/nodejs-datalabeling/commit/6b91e93e9c56697c07001323a84733f17992c3c5)) + +### [1.3.3](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.3.2...v1.3.3) (2019-11-15) + + +### Bug Fixes + +* **docs:** bump release level to beta ([#89](https://www.github.com/googleapis/nodejs-datalabeling/issues/89)) ([b3467e6](https://www.github.com/googleapis/nodejs-datalabeling/commit/b3467e656733702012348d2819c7ca6829bdc492)) + +### [1.3.2](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.3.1...v1.3.2) (2019-11-14) + + +### Bug Fixes + +* **docs:** snippets are now replaced in jsdoc comments ([#85](https://www.github.com/googleapis/nodejs-datalabeling/issues/85)) ([d1ebe18](https://www.github.com/googleapis/nodejs-datalabeling/commit/d1ebe186ae05e0d47d7cc78b095996dad1d4d506)) + +### [1.3.1](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.3.0...v1.3.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#80](https://www.github.com/googleapis/nodejs-datalabeling/issues/80)) ([32a1f60](https://www.github.com/googleapis/nodejs-datalabeling/commit/32a1f608198e0992c206c135784692810155eee6)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.2.0...v1.3.0) (2019-10-09) + + +### Bug Fixes + +* use compatible version of google-gax ([716b9f6](https://www.github.com/googleapis/nodejs-datalabeling/commit/716b9f6)) + + +### Features + +* .d.ts for protos ([#72](https://www.github.com/googleapis/nodejs-datalabeling/issues/72)) ([f6b4d28](https://www.github.com/googleapis/nodejs-datalabeling/commit/f6b4d28)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.1.3...v1.2.0) (2019-09-16) + + +### Bug Fixes + +* set proper version # for x-goog-api-client ([aeb0de9](https://www.github.com/googleapis/nodejs-datalabeling/commit/aeb0de9)) + + +### Features + +* load protos from JSON, grpc-fallback support ([3bc5d92](https://www.github.com/googleapis/nodejs-datalabeling/commit/3bc5d92)) + +### [1.1.3](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.1.2...v1.1.3) (2019-08-02) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([ed3743f](https://www.github.com/googleapis/nodejs-datalabeling/commit/ed3743f)) + +### [1.1.2](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.1.1...v1.1.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#51](https://www.github.com/googleapis/nodejs-datalabeling/issues/51)) ([8976320](https://www.github.com/googleapis/nodejs-datalabeling/commit/8976320)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.1.0...v1.1.1) (2019-06-14) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#46](https://www.github.com/googleapis/nodejs-datalabeling/issues/46)) ([d670a96](https://www.github.com/googleapis/nodejs-datalabeling/commit/d670a96)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v1.0.0...v1.1.0) (2019-06-06) + + +### Features + +* support apiEndpoint override in client constructor ([#41](https://www.github.com/googleapis/nodejs-datalabeling/issues/41)) ([7989746](https://www.github.com/googleapis/nodejs-datalabeling/commit/7989746)) +* support apiEndpoint override in client constructor ([#43](https://www.github.com/googleapis/nodejs-datalabeling/issues/43)) ([0bfe818](https://www.github.com/googleapis/nodejs-datalabeling/commit/0bfe818)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-datalabeling/compare/v0.1.0...v1.0.0) (2019-05-20) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#18) + +### Bug Fixes + +* **deps:** update dependency google-gax to ^0.26.0 ([#16](https://www.github.com/googleapis/nodejs-datalabeling/issues/16)) ([2783120](https://www.github.com/googleapis/nodejs-datalabeling/commit/2783120)) +* DEADLINE_EXCEEDED is no longer retried ([5cedb2d](https://www.github.com/googleapis/nodejs-datalabeling/commit/5cedb2d)) +* DEADLINE_EXCEEDED retry code is idempotent ([#27](https://www.github.com/googleapis/nodejs-datalabeling/issues/27)) ([00a9c2e](https://www.github.com/googleapis/nodejs-datalabeling/commit/00a9c2e)) +* **deps:** update dependency google-gax to v1 ([#26](https://www.github.com/googleapis/nodejs-datalabeling/issues/26)) ([482dab5](https://www.github.com/googleapis/nodejs-datalabeling/commit/482dab5)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#18](https://www.github.com/googleapis/nodejs-datalabeling/issues/18)) ([5affe85](https://www.github.com/googleapis/nodejs-datalabeling/commit/5affe85)) + +## v0.1.0 + +04-05-2019 14:33 PDT + +This is the initial release of the Node.js Data Labeling API client library. diff --git a/packages/google-cloud-datalabeling/CODE_OF_CONDUCT.md b/packages/google-cloud-datalabeling/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-datalabeling/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-datalabeling/CONTRIBUTING.md b/packages/google-cloud-datalabeling/CONTRIBUTING.md new file mode 100644 index 00000000000..1536096efcf --- /dev/null +++ b/packages/google-cloud-datalabeling/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 Data Labeling 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=datalabeling.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-datalabeling/LICENSE b/packages/google-cloud-datalabeling/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-datalabeling/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-datalabeling/README.md b/packages/google-cloud-datalabeling/README.md new file mode 100644 index 00000000000..013d0fbcee9 --- /dev/null +++ b/packages/google-cloud-datalabeling/README.md @@ -0,0 +1,185 @@ +[//]: # "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 Data Labeling: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/datalabeling.svg)](https://www.npmjs.org/package/@google-cloud/datalabeling) + + + + +Data Labeling 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-datalabeling/CHANGELOG.md). + +* [Google Cloud Data Labeling Node.js Client API Reference][client-docs] +* [Google Cloud Data Labeling Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-datalabeling](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datalabeling) + +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 Data Labeling 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/datalabeling +``` + + +### Using the client library + +```javascript +const {DataLabelingServiceClient} = require('@google-cloud/datalabeling'); +const client = new DataLabelingServiceClient(); + +async function quickstart() { + const parent = client.projectPath(projectId); + const [result] = await client.listDatasets({parent}); + console.log('Datasets:'); + console.log(result); +} +quickstart(); + +``` + + + +## 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 | +| --------------------------- | --------------------------------- | ------ | +| Data_labeling_service.create_annotation_spec_set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_annotation_spec_set.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-datalabeling/samples/generated/v1beta1/data_labeling_service.create_annotation_spec_set.js,samples/README.md) | +| Data_labeling_service.create_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.create_dataset.js,samples/README.md) | +| Data_labeling_service.create_evaluation_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.create_evaluation_job.js,samples/README.md) | +| Data_labeling_service.create_instruction | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_instruction.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-datalabeling/samples/generated/v1beta1/data_labeling_service.create_instruction.js,samples/README.md) | +| Data_labeling_service.delete_annotated_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotated_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotated_dataset.js,samples/README.md) | +| Data_labeling_service.delete_annotation_spec_set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotation_spec_set.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotation_spec_set.js,samples/README.md) | +| Data_labeling_service.delete_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_dataset.js,samples/README.md) | +| Data_labeling_service.delete_evaluation_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_evaluation_job.js,samples/README.md) | +| Data_labeling_service.delete_instruction | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_instruction.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_instruction.js,samples/README.md) | +| Data_labeling_service.export_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.export_data.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-datalabeling/samples/generated/v1beta1/data_labeling_service.export_data.js,samples/README.md) | +| Data_labeling_service.get_annotated_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotated_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotated_dataset.js,samples/README.md) | +| Data_labeling_service.get_annotation_spec_set | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotation_spec_set.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotation_spec_set.js,samples/README.md) | +| Data_labeling_service.get_data_item | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_data_item.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_data_item.js,samples/README.md) | +| Data_labeling_service.get_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_dataset.js,samples/README.md) | +| Data_labeling_service.get_evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation.js,samples/README.md) | +| Data_labeling_service.get_evaluation_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation_job.js,samples/README.md) | +| Data_labeling_service.get_example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_example.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_example.js,samples/README.md) | +| Data_labeling_service.get_instruction | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_instruction.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_instruction.js,samples/README.md) | +| Data_labeling_service.import_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.import_data.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-datalabeling/samples/generated/v1beta1/data_labeling_service.import_data.js,samples/README.md) | +| Data_labeling_service.label_image | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_image.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-datalabeling/samples/generated/v1beta1/data_labeling_service.label_image.js,samples/README.md) | +| Data_labeling_service.label_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_text.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-datalabeling/samples/generated/v1beta1/data_labeling_service.label_text.js,samples/README.md) | +| Data_labeling_service.label_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_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-datalabeling/samples/generated/v1beta1/data_labeling_service.label_video.js,samples/README.md) | +| Data_labeling_service.list_annotated_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotated_datasets.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotated_datasets.js,samples/README.md) | +| Data_labeling_service.list_annotation_spec_sets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotation_spec_sets.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotation_spec_sets.js,samples/README.md) | +| Data_labeling_service.list_data_items | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_data_items.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_data_items.js,samples/README.md) | +| Data_labeling_service.list_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_datasets.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_datasets.js,samples/README.md) | +| Data_labeling_service.list_evaluation_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_evaluation_jobs.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_evaluation_jobs.js,samples/README.md) | +| Data_labeling_service.list_examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_examples.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_examples.js,samples/README.md) | +| Data_labeling_service.list_instructions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_instructions.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_instructions.js,samples/README.md) | +| Data_labeling_service.pause_evaluation_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.pause_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.pause_evaluation_job.js,samples/README.md) | +| Data_labeling_service.resume_evaluation_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.resume_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.resume_evaluation_job.js,samples/README.md) | +| Data_labeling_service.search_evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_evaluations.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-datalabeling/samples/generated/v1beta1/data_labeling_service.search_evaluations.js,samples/README.md) | +| Data_labeling_service.search_example_comparisons | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_example_comparisons.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-datalabeling/samples/generated/v1beta1/data_labeling_service.search_example_comparisons.js,samples/README.md) | +| Data_labeling_service.update_evaluation_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.update_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.update_evaluation_job.js,samples/README.md) | +| Get Datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/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-datalabeling/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/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-datalabeling/samples/test/quickstart.test.js,samples/README.md) | + + + +The [Google Cloud Data Labeling 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/datalabeling@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 in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + + +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/datalabeling/latest +[product-docs]: https://cloud.google.com/data-labeling/docs/ +[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=datalabeling.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-datalabeling/linkinator.config.json b/packages/google-cloud-datalabeling/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-datalabeling/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-datalabeling/package.json b/packages/google-cloud-datalabeling/package.json new file mode 100644 index 00000000000..7e2e8b1608a --- /dev/null +++ b/packages/google-cloud-datalabeling/package.json @@ -0,0 +1,72 @@ +{ + "name": "@google-cloud/datalabeling", + "description": "Data Labeling API client for Node.js", + "version": "3.1.1", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "directory": "packages/google-cloud-datalabeling", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google datalabeling", + "datalabeling", + "Data Labeling API" + ], + "scripts": { + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "docs": "jsdoc -c .jsdoc.js", + "lint": "gts check", + "fix": "gts fix", + "docs-test": "linkinator docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "predocs-test": "npm run docs", + "prepare": "npm run compile", + "prelint": "cd samples; npm link ../; npm install", + "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", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datalabeling" +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/common_resources.proto b/packages/google-cloud-datalabeling/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// 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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/annotation.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/annotation.proto new file mode 100644 index 00000000000..d62cbfd136b --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/annotation.proto @@ -0,0 +1,345 @@ +// 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.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +// Specifies where the annotation comes from (whether it was provided by a +// human labeler or a different source). +enum AnnotationSource { + ANNOTATION_SOURCE_UNSPECIFIED = 0; + + // Answer is provided by a human contributor. + OPERATOR = 3; +} + +// Annotation for Example. Each example may have one or more annotations. For +// example in image classification problem, each image might have one or more +// labels. We call labels binded with this image an Annotation. +message Annotation { + // Output only. Unique name of this annotation, format is: + // + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset}/examples/{example_id}/annotations/{annotation_id} + string name = 1; + + // Output only. The source of the annotation. + AnnotationSource annotation_source = 2; + + // Output only. This is the actual annotation value, e.g classification, + // bounding box values are stored here. + AnnotationValue annotation_value = 3; + + // Output only. Annotation metadata, including information like votes + // for labels. + AnnotationMetadata annotation_metadata = 4; + + // Output only. Sentiment for this annotation. + AnnotationSentiment annotation_sentiment = 6; +} + +enum AnnotationSentiment { + ANNOTATION_SENTIMENT_UNSPECIFIED = 0; + + // This annotation describes negatively about the data. + NEGATIVE = 1; + + // This label describes positively about the data. + POSITIVE = 2; +} + +enum AnnotationType { + ANNOTATION_TYPE_UNSPECIFIED = 0; + + // Classification annotations in an image. Allowed for continuous evaluation. + IMAGE_CLASSIFICATION_ANNOTATION = 1; + + // Bounding box annotations in an image. A form of image object detection. + // Allowed for continuous evaluation. + IMAGE_BOUNDING_BOX_ANNOTATION = 2; + + // Oriented bounding box. The box does not have to be parallel to horizontal + // line. + IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION = 13; + + // Bounding poly annotations in an image. + IMAGE_BOUNDING_POLY_ANNOTATION = 10; + + // Polyline annotations in an image. + IMAGE_POLYLINE_ANNOTATION = 11; + + // Segmentation annotations in an image. + IMAGE_SEGMENTATION_ANNOTATION = 12; + + // Classification annotations in video shots. + VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3; + + // Video object tracking annotation. + VIDEO_OBJECT_TRACKING_ANNOTATION = 4; + + // Video object detection annotation. + VIDEO_OBJECT_DETECTION_ANNOTATION = 5; + + // Video event annotation. + VIDEO_EVENT_ANNOTATION = 6; + + // Classification for text. Allowed for continuous evaluation. + TEXT_CLASSIFICATION_ANNOTATION = 8; + + // Entity extraction for text. + TEXT_ENTITY_EXTRACTION_ANNOTATION = 9; + + // General classification. Allowed for continuous evaluation. + GENERAL_CLASSIFICATION_ANNOTATION = 14; +} + +// Annotation value for an example. +message AnnotationValue { + oneof value_type { + // Annotation value for image classification case. + ImageClassificationAnnotation image_classification_annotation = 1; + + // Annotation value for image bounding box, oriented bounding box + // and polygon cases. + ImageBoundingPolyAnnotation image_bounding_poly_annotation = 2; + + // Annotation value for image polyline cases. + // Polyline here is different from BoundingPoly. It is formed by + // line segments connected to each other but not closed form(Bounding Poly). + // The line segments can cross each other. + ImagePolylineAnnotation image_polyline_annotation = 8; + + // Annotation value for image segmentation. + ImageSegmentationAnnotation image_segmentation_annotation = 9; + + // Annotation value for text classification case. + TextClassificationAnnotation text_classification_annotation = 3; + + // Annotation value for text entity extraction case. + TextEntityExtractionAnnotation text_entity_extraction_annotation = 10; + + // Annotation value for video classification case. + VideoClassificationAnnotation video_classification_annotation = 4; + + // Annotation value for video object detection and tracking case. + VideoObjectTrackingAnnotation video_object_tracking_annotation = 5; + + // Annotation value for video event case. + VideoEventAnnotation video_event_annotation = 6; + } +} + +// Image classification annotation definition. +message ImageClassificationAnnotation { + // Label of image. + AnnotationSpec annotation_spec = 1; +} + +// A vertex represents a 2D point in the image. +// NOTE: the vertex coordinates are in the same scale as the original image. +message Vertex { + // X coordinate. + int32 x = 1; + + // Y coordinate. + int32 y = 2; +} + +// 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; +} + +// A bounding polygon in the image. +message BoundingPoly { + // The bounding polygon vertices. + repeated Vertex vertices = 1; +} + +// Normalized bounding polygon. +message NormalizedBoundingPoly { + // The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 1; +} + +// Image bounding poly annotation. It represents a polygon including +// bounding box in the image. +message ImageBoundingPolyAnnotation { + // The region of the polygon. If it is a bounding box, it is guaranteed to be + // four points. + oneof bounded_area { + BoundingPoly bounding_poly = 2; + + NormalizedBoundingPoly normalized_bounding_poly = 3; + } + + // Label of object in this bounding polygon. + AnnotationSpec annotation_spec = 1; +} + +// A line with multiple line segments. +message Polyline { + // The polyline vertices. + repeated Vertex vertices = 1; +} + +// Normalized polyline. +message NormalizedPolyline { + // The normalized polyline vertices. + repeated NormalizedVertex normalized_vertices = 1; +} + +// A polyline for the image annotation. +message ImagePolylineAnnotation { + oneof poly { + Polyline polyline = 2; + + NormalizedPolyline normalized_polyline = 3; + } + + // Label of this polyline. + AnnotationSpec annotation_spec = 1; +} + +// Image segmentation annotation. +message ImageSegmentationAnnotation { + // The mapping between rgb color and annotation spec. The key is the rgb + // color represented in format of rgb(0, 0, 0). The value is the + // AnnotationSpec. + map annotation_colors = 1; + + // Image format. + string mime_type = 2; + + // A byte string of a full image's color map. + bytes image_bytes = 3; +} + +// Text classification annotation. +message TextClassificationAnnotation { + // Label of the text. + AnnotationSpec annotation_spec = 1; +} + +// Text entity extraction annotation. +message TextEntityExtractionAnnotation { + // Label of the text entities. + AnnotationSpec annotation_spec = 1; + + // Position of the entity. + SequentialSegment sequential_segment = 2; +} + +// Start and end position in a sequence (e.g. text segment). +message SequentialSegment { + // Start position (inclusive). + int32 start = 1; + + // End position (exclusive). + int32 end = 2; +} + +// A time period inside of an example that has a time dimension (e.g. video). +message TimeSegment { + // Start of the time segment (inclusive), represented as the duration since + // the example start. + google.protobuf.Duration start_time_offset = 1; + + // End of the time segment (exclusive), represented as the duration since the + // example start. + google.protobuf.Duration end_time_offset = 2; +} + +// Video classification annotation. +message VideoClassificationAnnotation { + // The time segment of the video to which the annotation applies. + TimeSegment time_segment = 1; + + // Label of the segment specified by time_segment. + AnnotationSpec annotation_spec = 2; +} + +// Video frame level annotation for object detection and tracking. +message ObjectTrackingFrame { + // The bounding box location of this object track for the frame. + oneof bounded_area { + BoundingPoly bounding_poly = 1; + + NormalizedBoundingPoly normalized_bounding_poly = 2; + } + + // The time offset of this frame relative to the beginning of the video. + google.protobuf.Duration time_offset = 3; +} + +// Video object tracking annotation. +message VideoObjectTrackingAnnotation { + // Label of the object tracked in this annotation. + AnnotationSpec annotation_spec = 1; + + // The time segment of the video to which object tracking applies. + TimeSegment time_segment = 2; + + // The list of frames where this object track appears. + repeated ObjectTrackingFrame object_tracking_frames = 3; +} + +// Video event annotation. +message VideoEventAnnotation { + // Label of the event in this annotation. + AnnotationSpec annotation_spec = 1; + + // The time segment of the video to which the annotation applies. + TimeSegment time_segment = 2; +} + +// Additional information associated with the annotation. +message AnnotationMetadata { + // Metadata related to human labeling. + OperatorMetadata operator_metadata = 2; +} + +// General information useful for labels coming from contributors. +message OperatorMetadata { + // Confidence score corresponding to a label. For examle, if 3 contributors + // have answered the question and 2 of them agree on the final label, the + // confidence score will be 0.67 (2/3). + float score = 1; + + // The total number of contributors that answer this question. + int32 total_votes = 2; + + // The total number of contributors that choose this label. + int32 label_votes = 3; + + // Comments from contributors. + repeated string comments = 4; +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/annotation_spec_set.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/annotation_spec_set.proto new file mode 100644 index 00000000000..7670ae6a9f9 --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/annotation_spec_set.proto @@ -0,0 +1,71 @@ +// 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.datalabeling.v1beta1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +// An AnnotationSpecSet is a collection of label definitions. For example, in +// image classification tasks, you define a set of possible labels for images as +// an AnnotationSpecSet. An AnnotationSpecSet is immutable upon creation. +message AnnotationSpecSet { + option (google.api.resource) = { + type: "datalabeling.googleapis.com/AnnotationSpecSet" + pattern: "projects/{project}/annotationSpecSets/{annotation_spec_set}" + }; + + // Output only. The AnnotationSpecSet resource name in the following format: + // + // "projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}" + string name = 1; + + // Required. The display name for AnnotationSpecSet that you define when you + // create it. Maximum of 64 characters. + string display_name = 2; + + // Optional. User-provided description of the annotation specification set. + // The description can be up to 10,000 characters long. + string description = 3; + + // Required. The array of AnnotationSpecs that you define when you create the + // AnnotationSpecSet. These are the possible labels for the labeling task. + repeated AnnotationSpec annotation_specs = 4; + + // Output only. The names of any related resources that are blocking changes + // to the annotation spec set. + repeated string blocking_resources = 5; +} + +// Container of information related to one possible annotation that can be used +// in a labeling task. For example, an image classification task where images +// are labeled as `dog` or `cat` must reference an AnnotationSpec for `dog` and +// an AnnotationSpec for `cat`. +message AnnotationSpec { + // Required. The display name of the AnnotationSpec. Maximum of 64 characters. + string display_name = 1; + + // Optional. User-provided description of the annotation specification. + // The description can be up to 10,000 characters long. + string description = 2; +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/data_labeling_service.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/data_labeling_service.proto new file mode 100644 index 00000000000..5d0746c8a6d --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/data_labeling_service.proto @@ -0,0 +1,1236 @@ +// 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.datalabeling.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/cloud/datalabeling/v1beta1/evaluation.proto"; +import "google/cloud/datalabeling/v1beta1/evaluation_job.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/cloud/datalabeling/v1beta1/instruction.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +// Service for the AI Platform Data Labeling API. +service DataLabelingService { + option (google.api.default_host) = "datalabeling.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates dataset. If success return a Dataset resource. + rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/datasets" + body: "*" + }; + option (google.api.method_signature) = "parent,dataset"; + } + + // Gets dataset by resource name. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists datasets under a project. Pagination is supported. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/datasets" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Deletes a dataset by resource name. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Imports data into dataset based on source locations defined in request. + // It can be called multiple times for the same dataset. Each dataset can + // only have one long running operation running on it. For example, no + // labeling task (also long running operation) can be started while + // importing is still ongoing. Vice versa. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/datasets/*}:importData" + body: "*" + }; + option (google.api.method_signature) = "name,input_config"; + option (google.longrunning.operation_info) = { + response_type: "ImportDataOperationResponse" + metadata_type: "ImportDataOperationMetadata" + }; + } + + // Exports data and annotations from dataset. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/datasets/*}:exportData" + body: "*" + }; + option (google.api.method_signature) = "name,annotated_dataset,filter,output_config"; + option (google.longrunning.operation_info) = { + response_type: "ExportDataOperationResponse" + metadata_type: "ExportDataOperationMetadata" + }; + } + + // Gets a data item in a dataset by resource name. This API can be + // called after data are imported into dataset. + rpc GetDataItem(GetDataItemRequest) returns (DataItem) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/dataItems/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists data items in a dataset. This API can be called after data + // are imported into dataset. Pagination is supported. + rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/datasets/*}/dataItems" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Gets an annotated dataset by resource name. + rpc GetAnnotatedDataset(GetAnnotatedDatasetRequest) returns (AnnotatedDataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists annotated datasets for a dataset. Pagination is supported. + rpc ListAnnotatedDatasets(ListAnnotatedDatasetsRequest) returns (ListAnnotatedDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Deletes an annotated dataset by resource name. + rpc DeleteAnnotatedDataset(DeleteAnnotatedDatasetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + }; + } + + // Starts a labeling task for image. The type of image labeling task is + // configured by feature in the request. + rpc LabelImage(LabelImageRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/image:label" + body: "*" + }; + option (google.api.method_signature) = "parent,basic_config,feature"; + option (google.longrunning.operation_info) = { + response_type: "AnnotatedDataset" + metadata_type: "LabelOperationMetadata" + }; + } + + // Starts a labeling task for video. The type of video labeling task is + // configured by feature in the request. + rpc LabelVideo(LabelVideoRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/video:label" + body: "*" + }; + option (google.api.method_signature) = "parent,basic_config,feature"; + option (google.longrunning.operation_info) = { + response_type: "AnnotatedDataset" + metadata_type: "LabelOperationMetadata" + }; + } + + // Starts a labeling task for text. The type of text labeling task is + // configured by feature in the request. + rpc LabelText(LabelTextRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*}/text:label" + body: "*" + }; + option (google.api.method_signature) = "parent,basic_config,feature"; + option (google.longrunning.operation_info) = { + response_type: "AnnotatedDataset" + metadata_type: "LabelOperationMetadata" + }; + } + + // Gets an example by resource name, including both data and annotation. + rpc GetExample(GetExampleRequest) returns (Example) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}" + }; + option (google.api.method_signature) = "name,filter"; + } + + // Lists examples in an annotated dataset. Pagination is supported. + rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Creates an annotation spec set by providing a set of labels. + rpc CreateAnnotationSpecSet(CreateAnnotationSpecSetRequest) returns (AnnotationSpecSet) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/annotationSpecSets" + body: "*" + }; + option (google.api.method_signature) = "parent,annotation_spec_set"; + } + + // Gets an annotation spec set by resource name. + rpc GetAnnotationSpecSet(GetAnnotationSpecSetRequest) returns (AnnotationSpecSet) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/annotationSpecSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists annotation spec sets for a project. Pagination is supported. + rpc ListAnnotationSpecSets(ListAnnotationSpecSetsRequest) returns (ListAnnotationSpecSetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/annotationSpecSets" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Deletes an annotation spec set by resource name. + rpc DeleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/annotationSpecSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an instruction for how data should be labeled. + rpc CreateInstruction(CreateInstructionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/instructions" + body: "*" + }; + option (google.api.method_signature) = "parent,instruction"; + option (google.longrunning.operation_info) = { + response_type: "Instruction" + metadata_type: "CreateInstructionMetadata" + }; + } + + // Gets an instruction by resource name. + rpc GetInstruction(GetInstructionRequest) returns (Instruction) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/instructions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists instructions for a project. Pagination is supported. + rpc ListInstructions(ListInstructionsRequest) returns (ListInstructionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/instructions" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Deletes an instruction object by resource name. + rpc DeleteInstruction(DeleteInstructionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/instructions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets an evaluation by resource name (to search, use + // [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). + rpc GetEvaluation(GetEvaluationRequest) returns (Evaluation) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/datasets/*/evaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. + rpc SearchEvaluations(SearchEvaluationsRequest) returns (SearchEvaluationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/evaluations:search" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Searches example comparisons from an evaluation. The return format is a + // list of example comparisons that show ground truth and prediction(s) for + // a single input. Search by providing an evaluation ID. + rpc SearchExampleComparisons(SearchExampleComparisonsRequest) returns (SearchExampleComparisonsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/datasets/*/evaluations/*}/exampleComparisons:search" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates an evaluation job. + rpc CreateEvaluationJob(CreateEvaluationJobRequest) returns (EvaluationJob) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/evaluationJobs" + body: "*" + }; + option (google.api.method_signature) = "parent,job"; + } + + // Updates an evaluation job. You can only update certain fields of the job's + // [EvaluationJobConfig][google.cloud.datalabeling.v1beta1.EvaluationJobConfig]: `humanAnnotationConfig.instruction`, + // `exampleCount`, and `exampleSamplePercentage`. + // + // If you want to change any other aspect of the evaluation job, you must + // delete the job and create a new one. + rpc UpdateEvaluationJob(UpdateEvaluationJobRequest) returns (EvaluationJob) { + option (google.api.http) = { + patch: "/v1beta1/{evaluation_job.name=projects/*/evaluationJobs/*}" + body: "evaluation_job" + }; + option (google.api.method_signature) = "evaluation_job,update_mask"; + } + + // Gets an evaluation job by resource name. + rpc GetEvaluationJob(GetEvaluationJobRequest) returns (EvaluationJob) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/evaluationJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Pauses an evaluation job. Pausing an evaluation job that is already in a + // `PAUSED` state is a no-op. + rpc PauseEvaluationJob(PauseEvaluationJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/evaluationJobs/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Resumes a paused evaluation job. A deleted evaluation job can't be resumed. + // Resuming a running or scheduled evaluation job is a no-op. + rpc ResumeEvaluationJob(ResumeEvaluationJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/evaluationJobs/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Stops and deletes an evaluation job. + rpc DeleteEvaluationJob(DeleteEvaluationJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/evaluationJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all evaluation jobs within a project with possible filters. + // Pagination is supported. + rpc ListEvaluationJobs(ListEvaluationJobsRequest) returns (ListEvaluationJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/evaluationJobs" + }; + option (google.api.method_signature) = "parent,filter"; + } +} + +// Request message for CreateDataset. +message CreateDatasetRequest { + // Required. Dataset resource parent, format: + // projects/{project_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The dataset to be created. + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GetDataSet. +message GetDatasetRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; +} + +// Request message for ListDataset. +message ListDatasetsRequest { + // Required. Dataset resource parent, format: + // projects/{project_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. Filter on dataset is not supported at this moment. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token] of the previous + // [DataLabelingService.ListDatasets] call. + // Returns the first page if empty. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Results of listing datasets within a project. +message ListDatasetsResponse { + // The list of datasets to return. + repeated Dataset datasets = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for DeleteDataset. +message DeleteDatasetRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; +} + +// Request message for ImportData API. +message ImportDataRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; + + // Required. Specify the input source of the data. + InputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Email of the user who started the import task and should be notified by + // email. If empty no notification will be sent. + string user_email_address = 3; +} + +// Request message for ExportData API. +message ExportDataRequest { + // Required. Dataset resource name, format: + // projects/{project_id}/datasets/{dataset_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; + + // Required. Annotated dataset resource name. DataItem in + // Dataset and their annotations in specified annotated dataset will be + // exported. It's in format of + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string annotated_dataset = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + } + ]; + + // Optional. Filter is not supported at this moment. + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Specify the output destination. + OutputConfig output_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // Email of the user who started the export task and should be notified by + // email. If empty no notification will be sent. + string user_email_address = 5; +} + +// Request message for GetDataItem. +message GetDataItemRequest { + // Required. The name of the data item to get, format: + // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/DataItem" + } + ]; +} + +// Request message for ListDataItems. +message ListDataItemsRequest { + // Required. Name of the dataset to list data items, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; + + // Optional. Filter is not supported at this moment. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListDataItemsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token] of the previous + // [DataLabelingService.ListDataItems] call. + // Return first page if empty. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Results of listing data items in a dataset. +message ListDataItemsResponse { + // The list of data items to return. + repeated DataItem data_items = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for GetAnnotatedDataset. +message GetAnnotatedDatasetRequest { + // Required. Name of the annotated dataset to get, format: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + } + ]; +} + +// Request message for ListAnnotatedDatasets. +message ListAnnotatedDatasetsRequest { + // Required. Name of the dataset to list annotated datasets, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; + + // Optional. Filter is not supported at this moment. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListAnnotatedDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token] of the previous + // [DataLabelingService.ListAnnotatedDatasets] call. + // Return first page if empty. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Results of listing annotated datasets for a dataset. +message ListAnnotatedDatasetsResponse { + // The list of annotated datasets to return. + repeated AnnotatedDataset annotated_datasets = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for DeleteAnnotatedDataset. +message DeleteAnnotatedDatasetRequest { + // Required. Name of the annotated dataset to delete, format: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + } + ]; +} + +// Request message for starting an image labeling task. +message LabelImageRequest { + // Image labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Label whole image with one or more of labels. + CLASSIFICATION = 1; + + // Label image with bounding boxes for labels. + BOUNDING_BOX = 2; + + // Label oriented bounding box. The box does not have to be parallel to + // horizontal line. + ORIENTED_BOUNDING_BOX = 6; + + // Label images with bounding poly. A bounding poly is a plane figure that + // is bounded by a finite chain of straight line segments closing in a loop. + BOUNDING_POLY = 3; + + // Label images with polyline. Polyline is formed by connected line segments + // which are not in closed form. + POLYLINE = 4; + + // Label images with segmentation. Segmentation is different from bounding + // poly since it is more fine-grained, pixel level annotation. + SEGMENTATION = 5; + } + + // Required. Config for labeling tasks. The type of request config must + // match the selected feature. + oneof request_config { + // Configuration for image classification task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config are required. + ImageClassificationConfig image_classification_config = 4; + + // Configuration for bounding box and bounding poly task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config are required. + BoundingPolyConfig bounding_poly_config = 5; + + // Configuration for polyline task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config are required. + PolylineConfig polyline_config = 6; + + // Configuration for segmentation task. + // One of image_classification_config, bounding_poly_config, + // polyline_config and segmentation_config are required. + SegmentationConfig segmentation_config = 7; + } + + // Required. Name of the dataset to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of image labeling task. + Feature feature = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for LabelVideo. +message LabelVideoRequest { + // Video labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Label whole video or video segment with one or more labels. + CLASSIFICATION = 1; + + // Label objects with bounding box on image frames extracted from the video. + OBJECT_DETECTION = 2; + + // Label and track objects in video. + OBJECT_TRACKING = 3; + + // Label the range of video for the specified events. + EVENT = 4; + } + + // Required. Config for labeling tasks. The type of request config must + // match the selected feature. + oneof request_config { + // Configuration for video classification task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + VideoClassificationConfig video_classification_config = 4; + + // Configuration for video object detection task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + ObjectDetectionConfig object_detection_config = 5; + + // Configuration for video object tracking task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + ObjectTrackingConfig object_tracking_config = 6; + + // Configuration for video event task. + // One of video_classification_config, object_detection_config, + // object_tracking_config and event_config is required. + EventConfig event_config = 7; + } + + // Required. Name of the dataset to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of video labeling task. + Feature feature = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for LabelText. +message LabelTextRequest { + // Text labeling task feature. + enum Feature { + FEATURE_UNSPECIFIED = 0; + + // Label text content to one of more labels. + TEXT_CLASSIFICATION = 1; + + // Label entities and their span in text. + TEXT_ENTITY_EXTRACTION = 2; + } + + // Required. Config for labeling tasks. The type of request config must + // match the selected feature. + oneof request_config { + // Configuration for text classification task. + // One of text_classification_config and text_entity_extraction_config + // is required. + TextClassificationConfig text_classification_config = 4; + + // Configuration for entity extraction task. + // One of text_classification_config and text_entity_extraction_config + // is required. + TextEntityExtractionConfig text_entity_extraction_config = 5; + } + + // Required. Name of the data set to request labeling task, format: + // projects/{project_id}/datasets/{dataset_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; + + // Required. Basic human annotation config. + HumanAnnotationConfig basic_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of text labeling task. + Feature feature = 6 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GetExample +message GetExampleRequest { + // Required. Name of example, format: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id}/examples/{example_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Example" + } + ]; + + // Optional. An expression for filtering Examples. Filter by + // annotation_spec.display_name is supported. Format + // "annotation_spec.display_name = {display_name}" + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListExamples. +message ListExamplesRequest { + // Required. Example resource parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + } + ]; + + // Optional. An expression for filtering Examples. For annotated datasets that + // have annotation spec set, filter by + // annotation_spec.display_name is supported. Format + // "annotation_spec.display_name = {display_name}" + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListExamplesResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token] of the previous + // [DataLabelingService.ListExamples] call. + // Return first page if empty. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Results of listing Examples in and annotated dataset. +message ListExamplesResponse { + // The list of examples to return. + repeated Example examples = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for CreateAnnotationSpecSet. +message CreateAnnotationSpecSetRequest { + // Required. AnnotationSpecSet resource parent, format: + // projects/{project_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. Annotation spec set to create. Annotation specs must be included. + // Only one annotation spec will be accepted for annotation specs with same + // display_name. + AnnotationSpecSet annotation_spec_set = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GetAnnotationSpecSet. +message GetAnnotationSpecSetRequest { + // Required. AnnotationSpecSet resource name, format: + // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotationSpecSet" + } + ]; +} + +// Request message for ListAnnotationSpecSets. +message ListAnnotationSpecSetsRequest { + // Required. Parent of AnnotationSpecSet resource, format: + // projects/{project_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. Filter is not supported at this moment. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListAnnotationSpecSetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token] of the previous + // [DataLabelingService.ListAnnotationSpecSets] call. + // Return first page if empty. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Results of listing annotation spec set under a project. +message ListAnnotationSpecSetsResponse { + // The list of annotation spec sets. + repeated AnnotationSpecSet annotation_spec_sets = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for DeleteAnnotationSpecSet. +message DeleteAnnotationSpecSetRequest { + // Required. AnnotationSpec resource name, format: + // `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotationSpecSet" + } + ]; +} + +// Request message for CreateInstruction. +message CreateInstructionRequest { + // Required. Instruction resource parent, format: + // projects/{project_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. Instruction of how to perform the labeling task. + Instruction instruction = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GetInstruction. +message GetInstructionRequest { + // Required. Instruction resource name, format: + // projects/{project_id}/instructions/{instruction_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Instruction" + } + ]; +} + +// Request message for DeleteInstruction. +message DeleteInstructionRequest { + // Required. Instruction resource name, format: + // projects/{project_id}/instructions/{instruction_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Instruction" + } + ]; +} + +// Request message for ListInstructions. +message ListInstructionsRequest { + // Required. Instruction resource parent, format: + // projects/{project_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. Filter is not supported at this moment. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by + // [ListInstructionsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token] of the previous + // [DataLabelingService.ListInstructions] call. + // Return first page if empty. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Results of listing instructions under a project. +message ListInstructionsResponse { + // The list of Instructions to return. + repeated Instruction instructions = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for GetEvaluation. +message GetEvaluationRequest { + // Required. Name of the evaluation. Format: + // + // "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Evaluation" + } + ]; +} + +// Request message for SearchEvaluation. +message SearchEvaluationsRequest { + // Required. Evaluation search parent (project ID). Format: + // "projects/{project_id}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Evaluation" + } + ]; + + // Optional. To search evaluations, you can filter by the following: + // + // * evaluation_job.evaluation_job_id (the last part of + // [EvaluationJob.name][google.cloud.datalabeling.v1beta1.EvaluationJob.name]) + // * evaluation_job.model_id (the {model_name} portion + // of [EvaluationJob.modelVersion][google.cloud.datalabeling.v1beta1.EvaluationJob.model_version]) + // * evaluation_job.evaluation_job_run_time_start (Minimum + // threshold for the + // [evaluationJobRunTime][google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time] that created + // the evaluation) + // * evaluation_job.evaluation_job_run_time_end (Maximum + // threshold for the + // [evaluationJobRunTime][google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time] that created + // the evaluation) + // * evaluation_job.job_state ([EvaluationJob.state][google.cloud.datalabeling.v1beta1.EvaluationJob.state]) + // * annotation_spec.display_name (the Evaluation contains a + // metric for the annotation spec with this + // [displayName][google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name]) + // + // To filter by multiple critiera, use the `AND` operator or the `OR` + // operator. The following examples shows a string that filters by several + // critiera: + // + // "evaluation_job.evaluation_job_id = + // {evaluation_job_id} AND evaluation_job.model_id = + // {model_name} AND + // evaluation_job.evaluation_job_run_time_start = + // {timestamp_1} AND + // evaluation_job.evaluation_job_run_time_end = + // {timestamp_2} AND annotation_spec.display_name = + // {display_name}" + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by the + // [nextPageToken][google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.next_page_token] of the response + // to a previous search request. + // + // If you don't specify this field, the API call requests the first page of + // the search. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Results of searching evaluations. +message SearchEvaluationsResponse { + // The list of evaluations matching the search. + repeated Evaluation evaluations = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message of SearchExampleComparisons. +message SearchExampleComparisonsRequest { + // Required. Name of the [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] resource to search for example + // comparisons from. Format: + // + // "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Evaluation" + } + ]; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by the + // [nextPageToken][SearchExampleComparisons.next_page_token] of the response + // to a previous search rquest. + // + // If you don't specify this field, the API call requests the first page of + // the search. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Results of searching example comparisons. +message SearchExampleComparisonsResponse { + // Example comparisons comparing ground truth output and predictions for a + // specific input. + message ExampleComparison { + // The ground truth output for the input. + Example ground_truth_example = 1; + + // Predictions by the model for the input. + repeated Example model_created_examples = 2; + } + + // A list of example comparisons matching the search criteria. + repeated ExampleComparison example_comparisons = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} + +// Request message for CreateEvaluationJob. +message CreateEvaluationJobRequest { + // Required. Evaluation job resource parent. Format: + // "projects/{project_id}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The evaluation job to create. + EvaluationJob job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateEvaluationJob. +message UpdateEvaluationJobRequest { + // Required. Evaluation job that is going to be updated. + EvaluationJob evaluation_job = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Mask for which fields to update. You can only provide the + // following fields: + // + // * `evaluationJobConfig.humanAnnotationConfig.instruction` + // * `evaluationJobConfig.exampleCount` + // * `evaluationJobConfig.exampleSamplePercentage` + // + // You can provide more than one of these fields by separating them with + // commas. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetEvaluationJob. +message GetEvaluationJobRequest { + // Required. Name of the evaluation job. Format: + // + // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/EvaluationJob" + } + ]; +} + +// Request message for PauseEvaluationJob. +message PauseEvaluationJobRequest { + // Required. Name of the evaluation job that is going to be paused. Format: + // + // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/EvaluationJob" + } + ]; +} + +// Request message ResumeEvaluationJob. +message ResumeEvaluationJobRequest { + // Required. Name of the evaluation job that is going to be resumed. Format: + // + // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/EvaluationJob" + } + ]; +} + +// Request message DeleteEvaluationJob. +message DeleteEvaluationJobRequest { + // Required. Name of the evaluation job that is going to be deleted. Format: + // + // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/EvaluationJob" + } + ]; +} + +// Request message for ListEvaluationJobs. +message ListEvaluationJobsRequest { + // Required. Evaluation job resource parent. Format: + // "projects/{project_id}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. You can filter the jobs to list by model_id (also known as + // model_name, as described in + // [EvaluationJob.modelVersion][google.cloud.datalabeling.v1beta1.EvaluationJob.model_version]) or by + // evaluation job state (as described in [EvaluationJob.state][google.cloud.datalabeling.v1beta1.EvaluationJob.state]). To filter + // by both criteria, use the `AND` operator or the `OR` operator. For example, + // you can use the following string for your filter: + // "evaluation_job.model_id = {model_name} AND + // evaluation_job.state = {evaluation_job_state}" + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Requested page size. Server may return fewer results than + // requested. Default value is 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results for the server to return. + // Typically obtained by the + // [nextPageToken][google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.next_page_token] in the response + // to the previous request. The request returns the first page if this is + // empty. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Results for listing evaluation jobs. +message ListEvaluationJobsResponse { + // The list of evaluation jobs to return. + repeated EvaluationJob evaluation_jobs = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/data_payloads.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/data_payloads.proto new file mode 100644 index 00000000000..a9ca0fc93fe --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/data_payloads.proto @@ -0,0 +1,76 @@ +// 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.datalabeling.v1beta1; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +// Container of information about an image. +message ImagePayload { + // Image format. + string mime_type = 1; + + // A byte string of a thumbnail image. + bytes image_thumbnail = 2; + + // Image uri from the user bucket. + string image_uri = 3; + + // Signed uri of the image file in the service bucket. + string signed_uri = 4; +} + +// Container of information about a piece of text. +message TextPayload { + // Text content. + string text_content = 1; +} + +// Container of information of a video thumbnail. +message VideoThumbnail { + // A byte string of the video frame. + bytes thumbnail = 1; + + // Time offset relative to the beginning of the video, corresponding to the + // video frame where the thumbnail has been extracted from. + google.protobuf.Duration time_offset = 2; +} + +// Container of information of a video. +message VideoPayload { + // Video format. + string mime_type = 1; + + // Video uri from the user bucket. + string video_uri = 2; + + // The list of video thumbnails. + repeated VideoThumbnail video_thumbnails = 3; + + // FPS of the video. + float frame_rate = 4; + + // Signed uri of the video file in the service bucket. + string signed_uri = 5; +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/dataset.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/dataset.proto new file mode 100644 index 00000000000..557279fa746 --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/dataset.proto @@ -0,0 +1,347 @@ +// 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.datalabeling.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/datalabeling/v1beta1/annotation.proto"; +import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; +import "google/cloud/datalabeling/v1beta1/data_payloads.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +enum DataType { + DATA_TYPE_UNSPECIFIED = 0; + + // Allowed for continuous evaluation. + IMAGE = 1; + + VIDEO = 2; + + // Allowed for continuous evaluation. + TEXT = 4; + + // Allowed for continuous evaluation. + GENERAL_DATA = 6; +} + +// Dataset is the resource to hold your data. You can request multiple labeling +// tasks for a dataset while each one will generate an AnnotatedDataset. +message Dataset { + option (google.api.resource) = { + type: "datalabeling.googleapis.com/Dataset" + pattern: "projects/{project}/datasets/{dataset}" + }; + + // Output only. Dataset resource name, format is: + // projects/{project_id}/datasets/{dataset_id} + string name = 1; + + // Required. The display name of the dataset. Maximum of 64 characters. + string display_name = 2; + + // Optional. User-provided description of the annotation specification set. + // The description can be up to 10000 characters long. + string description = 3; + + // Output only. Time the dataset is created. + google.protobuf.Timestamp create_time = 4; + + // Output only. This is populated with the original input configs + // where ImportData is called. It is available only after the clients + // import data to this dataset. + repeated InputConfig input_configs = 5; + + // Output only. The names of any related resources that are blocking changes + // to the dataset. + repeated string blocking_resources = 6; + + // Output only. The number of data items in the dataset. + int64 data_item_count = 7; +} + +// The configuration of input data, including data type, location, etc. +message InputConfig { + // Optional. The metadata associated with each data type. + oneof data_type_metadata { + // Required for text import, as language code must be specified. + TextMetadata text_metadata = 6; + } + + // Required. Where the data is from. + oneof source { + // Source located in Cloud Storage. + GcsSource gcs_source = 2; + + // Source located in BigQuery. You must specify this field if you are using + // this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob]. + BigQuerySource bigquery_source = 5; + } + + // Required. Data type must be specifed when user tries to import data. + DataType data_type = 1; + + // Optional. The type of annotation to be performed on this data. You must + // specify this field if you are using this InputConfig in an + // [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob]. + AnnotationType annotation_type = 3; + + // Optional. Metadata about annotations for the input. You must specify this + // field if you are using this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] for a + // model version that performs classification. + ClassificationMetadata classification_metadata = 4; +} + +// Metadata for the text. +message TextMetadata { + // The language of this text, as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // Default value is en-US. + string language_code = 1; +} + +// Metadata for classification annotations. +message ClassificationMetadata { + // Whether the classification task is multi-label or not. + bool is_multi_label = 1; +} + +// Source of the Cloud Storage file to be imported. +message GcsSource { + // Required. The input URI of source file. This must be a Cloud Storage path + // (`gs://...`). + string input_uri = 1; + + // Required. The format of the source file. Only "text/csv" is supported. + string mime_type = 2; +} + +// The BigQuery location for input data. If used in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob], this +// is where the service saves the prediction input and output sampled from the +// model version. +message BigQuerySource { + // Required. BigQuery URI to a table, up to 2,000 characters long. If you + // specify the URI of a table that does not exist, Data Labeling Service + // creates a table at the URI with the correct schema when you create your + // [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob]. If you specify the URI of a table that already exists, + // it must have the + // [correct + // schema](/ml-engine/docs/continuous-evaluation/create-job#table-schema). + // + // Provide the table URI in the following format: + // + // "bq://{your_project_id}/{your_dataset_name}/{your_table_name}" + // + // [Learn + // more](/ml-engine/docs/continuous-evaluation/create-job#table-schema). + string input_uri = 1; +} + +// The configuration of output data. +message OutputConfig { + // Required. Location to output data to. + oneof destination { + // Output to a file in Cloud Storage. Should be used for labeling output + // other than image segmentation. + GcsDestination gcs_destination = 1; + + // Output to a folder in Cloud Storage. Should be used for image + // segmentation labeling output. + GcsFolderDestination gcs_folder_destination = 2; + } +} + +// Export destination of the data.Only gcs path is allowed in +// output_uri. +message GcsDestination { + // Required. The output uri of destination file. + string output_uri = 1; + + // Required. The format of the gcs destination. Only "text/csv" and + // "application/json" + // are supported. + string mime_type = 2; +} + +// Export folder destination of the data. +message GcsFolderDestination { + // Required. Cloud Storage directory to export data to. + string output_folder_uri = 1; +} + +// DataItem is a piece of data, without annotation. For example, an image. +message DataItem { + option (google.api.resource) = { + type: "datalabeling.googleapis.com/DataItem" + pattern: "projects/{project}/datasets/{dataset}/dataItems/{data_item}" + }; + + // Output only. + oneof payload { + // The image payload, a container of the image bytes/uri. + ImagePayload image_payload = 2; + + // The text payload, a container of text content. + TextPayload text_payload = 3; + + // The video payload, a container of the video uri. + VideoPayload video_payload = 4; + } + + // Output only. Name of the data item, in format of: + // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + string name = 1; +} + +// AnnotatedDataset is a set holding annotations for data in a Dataset. Each +// labeling task will generate an AnnotatedDataset under the Dataset that the +// task is requested for. +message AnnotatedDataset { + option (google.api.resource) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + pattern: "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}" + }; + + // Output only. AnnotatedDataset resource name in format of: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id} + string name = 1; + + // Output only. The display name of the AnnotatedDataset. It is specified in + // HumanAnnotationConfig when user starts a labeling task. Maximum of 64 + // characters. + string display_name = 2; + + // Output only. The description of the AnnotatedDataset. It is specified in + // HumanAnnotationConfig when user starts a labeling task. Maximum of 10000 + // characters. + string description = 9; + + // Output only. Source of the annotation. + AnnotationSource annotation_source = 3; + + // Output only. Type of the annotation. It is specified when starting labeling + // task. + AnnotationType annotation_type = 8; + + // Output only. Number of examples in the annotated dataset. + int64 example_count = 4; + + // Output only. Number of examples that have annotation in the annotated + // dataset. + int64 completed_example_count = 5; + + // Output only. Per label statistics. + LabelStats label_stats = 6; + + // Output only. Time the AnnotatedDataset was created. + google.protobuf.Timestamp create_time = 7; + + // Output only. Additional information about AnnotatedDataset. + AnnotatedDatasetMetadata metadata = 10; + + // Output only. The names of any related resources that are blocking changes + // to the annotated dataset. + repeated string blocking_resources = 11; +} + +// Statistics about annotation specs. +message LabelStats { + // Map of each annotation spec's example count. Key is the annotation spec + // name and value is the number of examples for that annotation spec. + // If the annotated dataset does not have annotation spec, the map will return + // a pair where the key is empty string and value is the total number of + // annotations. + map example_count = 1; +} + +// Metadata on AnnotatedDataset. +message AnnotatedDatasetMetadata { + // Specific request configuration used when requesting the labeling task. + oneof annotation_request_config { + // Configuration for image classification task. + ImageClassificationConfig image_classification_config = 2; + + // Configuration for image bounding box and bounding poly task. + BoundingPolyConfig bounding_poly_config = 3; + + // Configuration for image polyline task. + PolylineConfig polyline_config = 4; + + // Configuration for image segmentation task. + SegmentationConfig segmentation_config = 5; + + // Configuration for video classification task. + VideoClassificationConfig video_classification_config = 6; + + // Configuration for video object detection task. + ObjectDetectionConfig object_detection_config = 7; + + // Configuration for video object tracking task. + ObjectTrackingConfig object_tracking_config = 8; + + // Configuration for video event labeling task. + EventConfig event_config = 9; + + // Configuration for text classification task. + TextClassificationConfig text_classification_config = 10; + + // Configuration for text entity extraction task. + TextEntityExtractionConfig text_entity_extraction_config = 11; + } + + // HumanAnnotationConfig used when requesting the human labeling task for this + // AnnotatedDataset. + HumanAnnotationConfig human_annotation_config = 1; +} + +// An Example is a piece of data and its annotation. For example, an image with +// label "house". +message Example { + option (google.api.resource) = { + type: "datalabeling.googleapis.com/Example" + pattern: "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}" + }; + + // Output only. The data part of Example. + oneof payload { + // The image payload, a container of the image bytes/uri. + ImagePayload image_payload = 2; + + // The text payload, a container of the text content. + TextPayload text_payload = 6; + + // The video payload, a container of the video uri. + VideoPayload video_payload = 7; + } + + // Output only. Name of the example, in format of: + // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + // {annotated_dataset_id}/examples/{example_id} + string name = 1; + + // Output only. Annotations for the piece of data in Example. + // One piece of data can have multiple annotations. + repeated Annotation annotations = 5; +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/evaluation.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/evaluation.proto new file mode 100644 index 00000000000..950fa82cf45 --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/evaluation.proto @@ -0,0 +1,207 @@ +// 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.datalabeling.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/datalabeling/v1beta1/annotation.proto"; +import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +// Describes an evaluation between a machine learning model's predictions and +// ground truth labels. Created when an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] runs successfully. +message Evaluation { + option (google.api.resource) = { + type: "datalabeling.googleapis.com/Evaluation" + pattern: "projects/{project}/datasets/{dataset}/evaluations/{evaluation}" + }; + + // Output only. Resource name of an evaluation. The name has the following + // format: + // + // "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}' + string name = 1; + + // Output only. Options used in the evaluation job that created this + // evaluation. + EvaluationConfig config = 2; + + // Output only. Timestamp for when the evaluation job that created this + // evaluation ran. + google.protobuf.Timestamp evaluation_job_run_time = 3; + + // Output only. Timestamp for when this evaluation was created. + google.protobuf.Timestamp create_time = 4; + + // Output only. Metrics comparing predictions to ground truth labels. + EvaluationMetrics evaluation_metrics = 5; + + // Output only. Type of task that the model version being evaluated performs, + // as defined in the + // + // [evaluationJobConfig.inputConfig.annotationType][google.cloud.datalabeling.v1beta1.EvaluationJobConfig.input_config] + // field of the evaluation job that created this evaluation. + AnnotationType annotation_type = 6; + + // Output only. The number of items in the ground truth dataset that were used + // for this evaluation. Only populated when the evaulation is for certain + // AnnotationTypes. + int64 evaluated_item_count = 7; +} + +// Configuration details used for calculating evaluation metrics and creating an +// [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation]. +message EvaluationConfig { + // Vertical specific options for general metrics. + oneof vertical_option { + // Only specify this field if the related model performs image object + // detection (`IMAGE_BOUNDING_BOX_ANNOTATION`). Describes how to evaluate + // bounding boxes. + BoundingBoxEvaluationOptions bounding_box_evaluation_options = 1; + } +} + +// Options regarding evaluation between bounding boxes. +message BoundingBoxEvaluationOptions { + // Minimum + // [intersection-over-union + // + // (IOU)](/vision/automl/object-detection/docs/evaluate#intersection-over-union) + // required for 2 bounding boxes to be considered a match. This must be a + // number between 0 and 1. + float iou_threshold = 1; +} + +message EvaluationMetrics { + // Common metrics covering most general cases. + oneof metrics { + ClassificationMetrics classification_metrics = 1; + + ObjectDetectionMetrics object_detection_metrics = 2; + } +} + +// Metrics calculated for a classification model. +message ClassificationMetrics { + // Precision-recall curve based on ground truth labels, predicted labels, and + // scores for the predicted labels. + PrCurve pr_curve = 1; + + // Confusion matrix of predicted labels vs. ground truth labels. + ConfusionMatrix confusion_matrix = 2; +} + +// Metrics calculated for an image object detection (bounding box) model. +message ObjectDetectionMetrics { + // Precision-recall curve. + PrCurve pr_curve = 1; +} + +message PrCurve { + message ConfidenceMetricsEntry { + // Threshold used for this entry. + // + // For classification tasks, this is a classification threshold: a + // predicted label is categorized as positive or negative (in the context of + // this point on the PR curve) based on whether the label's score meets this + // threshold. + // + // For image object detection (bounding box) tasks, this is the + // [intersection-over-union + // + // (IOU)](/vision/automl/object-detection/docs/evaluate#intersection-over-union) + // threshold for the context of this point on the PR curve. + float confidence_threshold = 1; + + // Recall value. + float recall = 2; + + // Precision value. + float precision = 3; + + // Harmonic mean of recall and precision. + float f1_score = 4; + + // Recall value for entries with label that has highest score. + float recall_at1 = 5; + + // Precision value for entries with label that has highest score. + float precision_at1 = 6; + + // The harmonic mean of [recall_at1][google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.precision_at1]. + float f1_score_at1 = 7; + + // Recall value for entries with label that has highest 5 scores. + float recall_at5 = 8; + + // Precision value for entries with label that has highest 5 scores. + float precision_at5 = 9; + + // The harmonic mean of [recall_at5][google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.recall_at5] and [precision_at5][google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.precision_at5]. + float f1_score_at5 = 10; + } + + // The annotation spec of the label for which the precision-recall curve + // calculated. If this field is empty, that means the precision-recall curve + // is an aggregate curve for all labels. + AnnotationSpec annotation_spec = 1; + + // Area under the precision-recall curve. Not to be confused with area under + // a receiver operating characteristic (ROC) curve. + float area_under_curve = 2; + + // Entries that make up the precision-recall graph. Each entry is a "point" on + // the graph drawn for a different `confidence_threshold`. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 3; + + // Mean average prcision of this curve. + float mean_average_precision = 4; +} + +// Confusion matrix of the model running the classification. Only applicable +// when the metrics entry aggregates multiple labels. Not applicable when the +// entry is for a single label. +message ConfusionMatrix { + message ConfusionMatrixEntry { + // The annotation spec of a predicted label. + AnnotationSpec annotation_spec = 1; + + // Number of items predicted to have this label. (The ground truth label for + // these items is the `Row.annotationSpec` of this entry's parent.) + int32 item_count = 2; + } + + // A row in the confusion matrix. Each entry in this row has the same + // ground truth label. + message Row { + // The annotation spec of the ground truth label for this row. + AnnotationSpec annotation_spec = 1; + + // A list of the confusion matrix entries. One entry for each possible + // predicted label. + repeated ConfusionMatrixEntry entries = 2; + } + + repeated Row row = 1; +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/evaluation_job.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/evaluation_job.proto new file mode 100644 index 00000000000..d40f8f2016d --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/evaluation_job.proto @@ -0,0 +1,274 @@ +// 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.datalabeling.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/cloud/datalabeling/v1beta1/evaluation.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +// Defines an evaluation job that runs periodically to generate +// [Evaluations][google.cloud.datalabeling.v1beta1.Evaluation]. [Creating an evaluation +// job](/ml-engine/docs/continuous-evaluation/create-job) is the starting point +// for using continuous evaluation. +message EvaluationJob { + option (google.api.resource) = { + type: "datalabeling.googleapis.com/EvaluationJob" + pattern: "projects/{project}/evaluationJobs/{evaluation_job}" + }; + + // State of the job. + enum State { + STATE_UNSPECIFIED = 0; + + // The job is scheduled to run at the [configured interval][google.cloud.datalabeling.v1beta1.EvaluationJob.schedule]. You + // can [pause][google.cloud.datalabeling.v1beta1.DataLabelingService.PauseEvaluationJob] or + // [delete][google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteEvaluationJob] the job. + // + // When the job is in this state, it samples prediction input and output + // from your model version into your BigQuery table as predictions occur. + SCHEDULED = 1; + + // The job is currently running. When the job runs, Data Labeling Service + // does several things: + // + // 1. If you have configured your job to use Data Labeling Service for + // ground truth labeling, the service creates a + // [Dataset][google.cloud.datalabeling.v1beta1.Dataset] and a labeling task for all data sampled + // since the last time the job ran. Human labelers provide ground truth + // labels for your data. Human labeling may take hours, or even days, + // depending on how much data has been sampled. The job remains in the + // `RUNNING` state during this time, and it can even be running multiple + // times in parallel if it gets triggered again (for example 24 hours + // later) before the earlier run has completed. When human labelers have + // finished labeling the data, the next step occurs. + //

+ // If you have configured your job to provide your own ground truth + // labels, Data Labeling Service still creates a [Dataset][google.cloud.datalabeling.v1beta1.Dataset] for newly + // sampled data, but it expects that you have already added ground truth + // labels to the BigQuery table by this time. The next step occurs + // immediately. + // + // 2. Data Labeling Service creates an [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] by comparing your + // model version's predictions with the ground truth labels. + // + // If the job remains in this state for a long time, it continues to sample + // prediction data into your BigQuery table and will run again at the next + // interval, even if it causes the job to run multiple times in parallel. + RUNNING = 2; + + // The job is not sampling prediction input and output into your BigQuery + // table and it will not run according to its schedule. You can + // [resume][google.cloud.datalabeling.v1beta1.DataLabelingService.ResumeEvaluationJob] the job. + PAUSED = 3; + + // The job has this state right before it is deleted. + STOPPED = 4; + } + + // Output only. After you create a job, Data Labeling Service assigns a name + // to the job with the following format: + // + // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + string name = 1; + + // Required. Description of the job. The description can be up to 25,000 + // characters long. + string description = 2; + + // Output only. Describes the current state of the job. + State state = 3; + + // Required. Describes the interval at which the job runs. This interval must + // be at least 1 day, and it is rounded to the nearest day. For example, if + // you specify a 50-hour interval, the job runs every 2 days. + // + // You can provide the schedule in + // [crontab format](/scheduler/docs/configuring/cron-job-schedules) or in an + // [English-like + // format](/appengine/docs/standard/python/config/cronref#schedule_format). + // + // Regardless of what you specify, the job will run at 10:00 AM UTC. Only the + // interval from this schedule is used, not the specific time of day. + string schedule = 4; + + // Required. The [AI Platform Prediction model + // version](/ml-engine/docs/prediction-overview) to be evaluated. Prediction + // input and output is sampled from this model version. When creating an + // evaluation job, specify the model version in the following format: + // + // "projects/{project_id}/models/{model_name}/versions/{version_name}" + // + // There can only be one evaluation job per model version. + string model_version = 5; + + // Required. Configuration details for the evaluation job. + EvaluationJobConfig evaluation_job_config = 6; + + // Required. Name of the [AnnotationSpecSet][google.cloud.datalabeling.v1beta1.AnnotationSpecSet] describing all the + // labels that your machine learning model outputs. You must create this + // resource before you create an evaluation job and provide its name in the + // following format: + // + // "projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}" + string annotation_spec_set = 7; + + // Required. Whether you want Data Labeling Service to provide ground truth + // labels for prediction input. If you want the service to assign human + // labelers to annotate your data, set this to `true`. If you want to provide + // your own ground truth labels in the evaluation job's BigQuery table, set + // this to `false`. + bool label_missing_ground_truth = 8; + + // Output only. Every time the evaluation job runs and an error occurs, the + // failed attempt is appended to this array. + repeated Attempt attempts = 9; + + // Output only. Timestamp of when this evaluation job was created. + google.protobuf.Timestamp create_time = 10; +} + +// Configures specific details of how a continuous evaluation job works. Provide +// this configuration when you create an EvaluationJob. +message EvaluationJobConfig { + // Required. Details for how you want human reviewers to provide ground truth + // labels. + oneof human_annotation_request_config { + // Specify this field if your model version performs image classification or + // general classification. + // + // `annotationSpecSet` in this configuration must match + // [EvaluationJob.annotationSpecSet][google.cloud.datalabeling.v1beta1.EvaluationJob.annotation_spec_set]. + // `allowMultiLabel` in this configuration must match + // `classificationMetadata.isMultiLabel` in [input_config][google.cloud.datalabeling.v1beta1.EvaluationJobConfig.input_config]. + ImageClassificationConfig image_classification_config = 4; + + // Specify this field if your model version performs image object detection + // (bounding box detection). + // + // `annotationSpecSet` in this configuration must match + // [EvaluationJob.annotationSpecSet][google.cloud.datalabeling.v1beta1.EvaluationJob.annotation_spec_set]. + BoundingPolyConfig bounding_poly_config = 5; + + // Specify this field if your model version performs text classification. + // + // `annotationSpecSet` in this configuration must match + // [EvaluationJob.annotationSpecSet][google.cloud.datalabeling.v1beta1.EvaluationJob.annotation_spec_set]. + // `allowMultiLabel` in this configuration must match + // `classificationMetadata.isMultiLabel` in [input_config][google.cloud.datalabeling.v1beta1.EvaluationJobConfig.input_config]. + TextClassificationConfig text_classification_config = 8; + } + + // Rquired. Details for the sampled prediction input. Within this + // configuration, there are requirements for several fields: + // + // * `dataType` must be one of `IMAGE`, `TEXT`, or `GENERAL_DATA`. + // * `annotationType` must be one of `IMAGE_CLASSIFICATION_ANNOTATION`, + // `TEXT_CLASSIFICATION_ANNOTATION`, `GENERAL_CLASSIFICATION_ANNOTATION`, + // or `IMAGE_BOUNDING_BOX_ANNOTATION` (image object detection). + // * If your machine learning model performs classification, you must specify + // `classificationMetadata.isMultiLabel`. + // * You must specify `bigquerySource` (not `gcsSource`). + InputConfig input_config = 1; + + // Required. Details for calculating evaluation metrics and creating + // [Evaulations][google.cloud.datalabeling.v1beta1.Evaluation]. If your model version performs image object + // detection, you must specify the `boundingBoxEvaluationOptions` field within + // this configuration. Otherwise, provide an empty object for this + // configuration. + EvaluationConfig evaluation_config = 2; + + // Optional. Details for human annotation of your data. If you set + // [labelMissingGroundTruth][google.cloud.datalabeling.v1beta1.EvaluationJob.label_missing_ground_truth] to + // `true` for this evaluation job, then you must specify this field. If you + // plan to provide your own ground truth labels, then omit this field. + // + // Note that you must create an [Instruction][google.cloud.datalabeling.v1beta1.Instruction] resource before you can + // specify this field. Provide the name of the instruction resource in the + // `instruction` field within this configuration. + HumanAnnotationConfig human_annotation_config = 3; + + // Required. Prediction keys that tell Data Labeling Service where to find the + // data for evaluation in your BigQuery table. When the service samples + // prediction input and output from your model version and saves it to + // BigQuery, the data gets stored as JSON strings in the BigQuery table. These + // keys tell Data Labeling Service how to parse the JSON. + // + // You can provide the following entries in this field: + // + // * `data_json_key`: the data key for prediction input. You must provide + // either this key or `reference_json_key`. + // * `reference_json_key`: the data reference key for prediction input. You + // must provide either this key or `data_json_key`. + // * `label_json_key`: the label key for prediction output. Required. + // * `label_score_json_key`: the score key for prediction output. Required. + // * `bounding_box_json_key`: the bounding box key for prediction output. + // Required if your model version perform image object detection. + // + // Learn [how to configure prediction + // keys](/ml-engine/docs/continuous-evaluation/create-job#prediction-keys). + map bigquery_import_keys = 9; + + // Required. The maximum number of predictions to sample and save to BigQuery + // during each [evaluation interval][google.cloud.datalabeling.v1beta1.EvaluationJob.schedule]. This limit + // overrides `example_sample_percentage`: even if the service has not sampled + // enough predictions to fulfill `example_sample_perecentage` during an + // interval, it stops sampling predictions when it meets this limit. + int32 example_count = 10; + + // Required. Fraction of predictions to sample and save to BigQuery during + // each [evaluation interval][google.cloud.datalabeling.v1beta1.EvaluationJob.schedule]. For example, 0.1 means + // 10% of predictions served by your model version get saved to BigQuery. + double example_sample_percentage = 11; + + // Optional. Configuration details for evaluation job alerts. Specify this + // field if you want to receive email alerts if the evaluation job finds that + // your predictions have low mean average precision during a run. + EvaluationJobAlertConfig evaluation_job_alert_config = 13; +} + +// Provides details for how an evaluation job sends email alerts based on the +// results of a run. +message EvaluationJobAlertConfig { + // Required. An email address to send alerts to. + string email = 1; + + // Required. A number between 0 and 1 that describes a minimum mean average + // precision threshold. When the evaluation job runs, if it calculates that + // your model version's predictions from the recent interval have + // [meanAveragePrecision][google.cloud.datalabeling.v1beta1.PrCurve.mean_average_precision] below this + // threshold, then it sends an alert to your specified email. + double min_acceptable_mean_average_precision = 2; +} + +// Records a failed evaluation job run. +message Attempt { + google.protobuf.Timestamp attempt_time = 1; + + // Details of errors that occurred. + repeated google.rpc.Status partial_failures = 2; +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/human_annotation_config.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/human_annotation_config.proto new file mode 100644 index 00000000000..9cc2424be4d --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/human_annotation_config.proto @@ -0,0 +1,211 @@ +// 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.datalabeling.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +enum StringAggregationType { + STRING_AGGREGATION_TYPE_UNSPECIFIED = 0; + + // Majority vote to aggregate answers. + MAJORITY_VOTE = 1; + + // Unanimous answers will be adopted. + UNANIMOUS_VOTE = 2; + + // Preserve all answers by crowd compute. + NO_AGGREGATION = 3; +} + +// Configuration for how human labeling task should be done. +message HumanAnnotationConfig { + // Required. Instruction resource name. + string instruction = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A human-readable name for AnnotatedDataset defined by + // users. Maximum of 64 characters + // . + string annotated_dataset_display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A human-readable description for AnnotatedDataset. + // The description can be up to 10000 characters long. + string annotated_dataset_description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A human-readable label used to logically group labeling tasks. + // This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`. + string label_group = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Language of this question, as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // Default value is en-US. + // Only need to set this when task is language related. For example, French + // text classification. + string language_code = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Replication of questions. Each question will be sent to up to + // this number of contributors to label. Aggregated answers will be returned. + // Default is set to 1. + // For image related labeling, valid values are 1, 3, 5. + int32 replica_count = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum duration for contributors to answer a question. Maximum + // is 3600 seconds. Default is 3600 seconds. + google.protobuf.Duration question_duration = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If you want your own labeling contributors to manage and work on + // this labeling request, you can set these contributors here. We will give + // them access to the question types in crowdcompute. Note that these + // emails must be registered in crowdcompute worker UI: + // https://crowd-compute.appspot.com/ + repeated string contributor_emails = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Email of the user who started the labeling task and should be notified by + // email. If empty no notification will be sent. + string user_email_address = 10; +} + +// Config for image classification human labeling task. +message ImageClassificationConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If allow_multi_label is true, contributors are able to choose + // multiple labels for one image. + bool allow_multi_label = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of how to aggregate answers. + StringAggregationType answer_aggregation_type = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Config for image bounding poly (and bounding box) human labeling task. +message BoundingPolyConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Instruction message showed on contributors UI. + string instruction_message = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Config for image polyline human labeling task. +message PolylineConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Instruction message showed on contributors UI. + string instruction_message = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Config for image segmentation +message SegmentationConfig { + // Required. Annotation spec set resource name. format: + // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // Instruction message showed on labelers UI. + string instruction_message = 2; +} + +// Config for video classification human labeling task. +// Currently two types of video classification are supported: +// 1. Assign labels on the entire video. +// 2. Split the video into multiple video clips based on camera shot, and +// assign labels on each video clip. +message VideoClassificationConfig { + // Annotation spec set with the setting of allowing multi labels or not. + message AnnotationSpecSetConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If allow_multi_label is true, contributors are able to + // choose multiple labels from one annotation spec set. + bool allow_multi_label = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The list of annotation spec set configs. + // Since watching a video clip takes much longer time than an image, we + // support label with multiple AnnotationSpecSet at the same time. Labels + // in each AnnotationSpecSet will be shown in a group to contributors. + // Contributors can select one or more (depending on whether to allow multi + // label) from each group. + repeated AnnotationSpecSetConfig annotation_spec_set_configs = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Option to apply shot detection on the video. + bool apply_shot_detection = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Config for video object detection human labeling task. +// Object detection will be conducted on the images extracted from the video, +// and those objects will be labeled with bounding boxes. +// User need to specify the number of images to be extracted per second as the +// extraction frame rate. +message ObjectDetectionConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Number of frames per second to be extracted from the video. + double extraction_frame_rate = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Config for video object tracking human labeling task. +message ObjectTrackingConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Config for video event human labeling task. +message EventConfig { + // Required. The list of annotation spec set resource name. Similar to video + // classification, we support selecting event from multiple AnnotationSpecSet + // at the same time. + repeated string annotation_spec_sets = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Config for text classification human labeling task. +message TextClassificationConfig { + // Optional. If allow_multi_label is true, contributors are able to choose + // multiple labels for one text segment. + bool allow_multi_label = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Annotation spec set resource name. + string annotation_spec_set = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Configs for sentiment selection. + SentimentConfig sentiment_config = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Config for setting up sentiments. +message SentimentConfig { + // If set to true, contributors will have the option to select sentiment of + // the label they selected, to mark it as negative or positive label. Default + // is false. + bool enable_label_sentiment_selection = 1; +} + +// Config for text entity extraction human labeling task. +message TextEntityExtractionConfig { + // Required. Annotation spec set resource name. + string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/instruction.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/instruction.proto new file mode 100644 index 00000000000..9b19d32fdc5 --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/instruction.proto @@ -0,0 +1,87 @@ +// 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.datalabeling.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +// Instruction of how to perform the labeling task for human operators. +// Currently only PDF instruction is supported. +message Instruction { + option (google.api.resource) = { + type: "datalabeling.googleapis.com/Instruction" + pattern: "projects/{project}/instructions/{instruction}" + }; + + // Output only. Instruction resource name, format: + // projects/{project_id}/instructions/{instruction_id} + string name = 1; + + // Required. The display name of the instruction. Maximum of 64 characters. + string display_name = 2; + + // Optional. User-provided description of the instruction. + // The description can be up to 10000 characters long. + string description = 3; + + // Output only. Creation time of instruction. + google.protobuf.Timestamp create_time = 4; + + // Output only. Last update time of instruction. + google.protobuf.Timestamp update_time = 5; + + // Required. The data type of this instruction. + DataType data_type = 6; + + // Deprecated: this instruction format is not supported any more. + // Instruction from a CSV file, such as for classification task. + // The CSV file should have exact two columns, in the following format: + // + // * The first column is labeled data, such as an image reference, text. + // * The second column is comma separated labels associated with data. + CsvInstruction csv_instruction = 7 [deprecated = true]; + + // Instruction from a PDF document. The PDF should be in a Cloud Storage + // bucket. + PdfInstruction pdf_instruction = 9; + + // Output only. The names of any related resources that are blocking changes + // to the instruction. + repeated string blocking_resources = 10; +} + +// Deprecated: this instruction format is not supported any more. +// Instruction from a CSV file. +message CsvInstruction { + // CSV file for the instruction. Only gcs path is allowed. + string gcs_file_uri = 1; +} + +// Instruction from a PDF file. +message PdfInstruction { + // PDF file for the instruction. Only gcs path is allowed. + string gcs_file_uri = 1; +} diff --git a/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/operations.proto b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/operations.proto new file mode 100644 index 00000000000..02d596fc9c6 --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/google/cloud/datalabeling/v1beta1/operations.proto @@ -0,0 +1,232 @@ +// 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.datalabeling.v1beta1; + +import "google/cloud/datalabeling/v1beta1/dataset.proto"; +import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datalabeling.v1beta1"; +option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1"; +option ruby_package = "Google::Cloud::DataLabeling::V1beta1"; + +// Response used for ImportData longrunning operation. +message ImportDataOperationResponse { + // Ouptut only. The name of imported dataset. + string dataset = 1; + + // Output only. Total number of examples requested to import + int32 total_count = 2; + + // Output only. Number of examples imported successfully. + int32 import_count = 3; +} + +// Response used for ExportDataset longrunning operation. +message ExportDataOperationResponse { + // Ouptut only. The name of dataset. + // "projects/*/datasets/*" + string dataset = 1; + + // Output only. Total number of examples requested to export + int32 total_count = 2; + + // Output only. Number of examples exported successfully. + int32 export_count = 3; + + // Output only. Statistic infos of labels in the exported dataset. + LabelStats label_stats = 4; + + // Output only. output_config in the ExportData request. + OutputConfig output_config = 5; +} + +// Metadata of an ImportData operation. +message ImportDataOperationMetadata { + // Output only. The name of imported dataset. + // "projects/*/datasets/*" + string dataset = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Output only. Timestamp when import dataset request was created. + google.protobuf.Timestamp create_time = 3; +} + +// Metadata of an ExportData operation. +message ExportDataOperationMetadata { + // Output only. The name of dataset to be exported. + // "projects/*/datasets/*" + string dataset = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Output only. Timestamp when export dataset request was created. + google.protobuf.Timestamp create_time = 3; +} + +// Metadata of a labeling operation, such as LabelImage or LabelVideo. +// Next tag: 20 +message LabelOperationMetadata { + // Ouptut only. Details of specific label operation. + oneof details { + // Details of label image classification operation. + LabelImageClassificationOperationMetadata image_classification_details = 3; + + // Details of label image bounding box operation. + LabelImageBoundingBoxOperationMetadata image_bounding_box_details = 4; + + // Details of label image bounding poly operation. + LabelImageBoundingPolyOperationMetadata image_bounding_poly_details = 11; + + // Details of label image oriented bounding box operation. + LabelImageOrientedBoundingBoxOperationMetadata image_oriented_bounding_box_details = 14; + + // Details of label image polyline operation. + LabelImagePolylineOperationMetadata image_polyline_details = 12; + + // Details of label image segmentation operation. + LabelImageSegmentationOperationMetadata image_segmentation_details = 15; + + // Details of label video classification operation. + LabelVideoClassificationOperationMetadata video_classification_details = 5; + + // Details of label video object detection operation. + LabelVideoObjectDetectionOperationMetadata video_object_detection_details = 6; + + // Details of label video object tracking operation. + LabelVideoObjectTrackingOperationMetadata video_object_tracking_details = 7; + + // Details of label video event operation. + LabelVideoEventOperationMetadata video_event_details = 8; + + // Details of label text classification operation. + LabelTextClassificationOperationMetadata text_classification_details = 9; + + // Details of label text entity extraction operation. + LabelTextEntityExtractionOperationMetadata text_entity_extraction_details = 13; + } + + // Output only. Progress of label operation. Range: [0, 100]. + int32 progress_percent = 1; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Output only. Timestamp when labeling request was created. + google.protobuf.Timestamp create_time = 16; +} + +// Metadata of a LabelImageClassification operation. +message LabelImageClassificationOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelImageBoundingBox operation metadata. +message LabelImageBoundingBoxOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelImageOrientedBoundingBox operation metadata. +message LabelImageOrientedBoundingBoxOperationMetadata { + // Basic human annotation config. + HumanAnnotationConfig basic_config = 1; +} + +// Details of LabelImageBoundingPoly operation metadata. +message LabelImageBoundingPolyOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of LabelImagePolyline operation metadata. +message LabelImagePolylineOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelImageSegmentation operation metadata. +message LabelImageSegmentationOperationMetadata { + // Basic human annotation config. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoClassification operation metadata. +message LabelVideoClassificationOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoObjectDetection operation metadata. +message LabelVideoObjectDetectionOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoObjectTracking operation metadata. +message LabelVideoObjectTrackingOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelVideoEvent operation metadata. +message LabelVideoEventOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelTextClassification operation metadata. +message LabelTextClassificationOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Details of a LabelTextEntityExtraction operation metadata. +message LabelTextEntityExtractionOperationMetadata { + // Basic human annotation config used in labeling request. + HumanAnnotationConfig basic_config = 1; +} + +// Metadata of a CreateInstruction operation. +message CreateInstructionMetadata { + // The name of the created Instruction. + // projects/{project_id}/instructions/{instruction_id} + string instruction = 1; + + // Partial failures encountered. + // E.g. single files that couldn't be read. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Timestamp when create instruction request was created. + google.protobuf.Timestamp create_time = 3; +} diff --git a/packages/google-cloud-datalabeling/protos/protos.d.ts b/packages/google-cloud-datalabeling/protos/protos.d.ts new file mode 100644 index 00000000000..b95ae9c94bf --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/protos.d.ts @@ -0,0 +1,21047 @@ +// 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 datalabeling. */ + namespace datalabeling { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** AnnotationSource enum. */ + enum AnnotationSource { + ANNOTATION_SOURCE_UNSPECIFIED = 0, + OPERATOR = 3 + } + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation name */ + name?: (string|null); + + /** Annotation annotationSource */ + annotationSource?: (google.cloud.datalabeling.v1beta1.AnnotationSource|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationSource|null); + + /** Annotation annotationValue */ + annotationValue?: (google.cloud.datalabeling.v1beta1.IAnnotationValue|null); + + /** Annotation annotationMetadata */ + annotationMetadata?: (google.cloud.datalabeling.v1beta1.IAnnotationMetadata|null); + + /** Annotation annotationSentiment */ + annotationSentiment?: (google.cloud.datalabeling.v1beta1.AnnotationSentiment|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationSentiment|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IAnnotation); + + /** Annotation name. */ + public name: string; + + /** Annotation annotationSource. */ + public annotationSource: (google.cloud.datalabeling.v1beta1.AnnotationSource|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationSource); + + /** Annotation annotationValue. */ + public annotationValue?: (google.cloud.datalabeling.v1beta1.IAnnotationValue|null); + + /** Annotation annotationMetadata. */ + public annotationMetadata?: (google.cloud.datalabeling.v1beta1.IAnnotationMetadata|null); + + /** Annotation annotationSentiment. */ + public annotationSentiment: (google.cloud.datalabeling.v1beta1.AnnotationSentiment|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationSentiment); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IAnnotation): google.cloud.datalabeling.v1beta1.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.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; + } + + /** AnnotationSentiment enum. */ + enum AnnotationSentiment { + ANNOTATION_SENTIMENT_UNSPECIFIED = 0, + NEGATIVE = 1, + POSITIVE = 2 + } + + /** AnnotationType enum. */ + enum AnnotationType { + ANNOTATION_TYPE_UNSPECIFIED = 0, + IMAGE_CLASSIFICATION_ANNOTATION = 1, + IMAGE_BOUNDING_BOX_ANNOTATION = 2, + IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION = 13, + IMAGE_BOUNDING_POLY_ANNOTATION = 10, + IMAGE_POLYLINE_ANNOTATION = 11, + IMAGE_SEGMENTATION_ANNOTATION = 12, + VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3, + VIDEO_OBJECT_TRACKING_ANNOTATION = 4, + VIDEO_OBJECT_DETECTION_ANNOTATION = 5, + VIDEO_EVENT_ANNOTATION = 6, + TEXT_CLASSIFICATION_ANNOTATION = 8, + TEXT_ENTITY_EXTRACTION_ANNOTATION = 9, + GENERAL_CLASSIFICATION_ANNOTATION = 14 + } + + /** Properties of an AnnotationValue. */ + interface IAnnotationValue { + + /** AnnotationValue imageClassificationAnnotation */ + imageClassificationAnnotation?: (google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation|null); + + /** AnnotationValue imageBoundingPolyAnnotation */ + imageBoundingPolyAnnotation?: (google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation|null); + + /** AnnotationValue imagePolylineAnnotation */ + imagePolylineAnnotation?: (google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation|null); + + /** AnnotationValue imageSegmentationAnnotation */ + imageSegmentationAnnotation?: (google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation|null); + + /** AnnotationValue textClassificationAnnotation */ + textClassificationAnnotation?: (google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation|null); + + /** AnnotationValue textEntityExtractionAnnotation */ + textEntityExtractionAnnotation?: (google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation|null); + + /** AnnotationValue videoClassificationAnnotation */ + videoClassificationAnnotation?: (google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation|null); + + /** AnnotationValue videoObjectTrackingAnnotation */ + videoObjectTrackingAnnotation?: (google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation|null); + + /** AnnotationValue videoEventAnnotation */ + videoEventAnnotation?: (google.cloud.datalabeling.v1beta1.IVideoEventAnnotation|null); + } + + /** Represents an AnnotationValue. */ + class AnnotationValue implements IAnnotationValue { + + /** + * Constructs a new AnnotationValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IAnnotationValue); + + /** AnnotationValue imageClassificationAnnotation. */ + public imageClassificationAnnotation?: (google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation|null); + + /** AnnotationValue imageBoundingPolyAnnotation. */ + public imageBoundingPolyAnnotation?: (google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation|null); + + /** AnnotationValue imagePolylineAnnotation. */ + public imagePolylineAnnotation?: (google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation|null); + + /** AnnotationValue imageSegmentationAnnotation. */ + public imageSegmentationAnnotation?: (google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation|null); + + /** AnnotationValue textClassificationAnnotation. */ + public textClassificationAnnotation?: (google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation|null); + + /** AnnotationValue textEntityExtractionAnnotation. */ + public textEntityExtractionAnnotation?: (google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation|null); + + /** AnnotationValue videoClassificationAnnotation. */ + public videoClassificationAnnotation?: (google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation|null); + + /** AnnotationValue videoObjectTrackingAnnotation. */ + public videoObjectTrackingAnnotation?: (google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation|null); + + /** AnnotationValue videoEventAnnotation. */ + public videoEventAnnotation?: (google.cloud.datalabeling.v1beta1.IVideoEventAnnotation|null); + + /** AnnotationValue valueType. */ + public valueType?: ("imageClassificationAnnotation"|"imageBoundingPolyAnnotation"|"imagePolylineAnnotation"|"imageSegmentationAnnotation"|"textClassificationAnnotation"|"textEntityExtractionAnnotation"|"videoClassificationAnnotation"|"videoObjectTrackingAnnotation"|"videoEventAnnotation"); + + /** + * Creates a new AnnotationValue instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationValue instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IAnnotationValue): google.cloud.datalabeling.v1beta1.AnnotationValue; + + /** + * Encodes the specified AnnotationValue message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationValue.verify|verify} messages. + * @param message AnnotationValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IAnnotationValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationValue message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationValue.verify|verify} messages. + * @param message AnnotationValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IAnnotationValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.AnnotationValue; + + /** + * Decodes an AnnotationValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.AnnotationValue; + + /** + * Verifies an AnnotationValue message. + * @param message Plain 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 AnnotationValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.AnnotationValue; + + /** + * Creates a plain object from an AnnotationValue message. Also converts values to other types if specified. + * @param message AnnotationValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.AnnotationValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationAnnotation. */ + interface IImageClassificationAnnotation { + + /** ImageClassificationAnnotation annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + } + + /** Represents an ImageClassificationAnnotation. */ + class ImageClassificationAnnotation implements IImageClassificationAnnotation { + + /** + * Constructs a new ImageClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation); + + /** ImageClassificationAnnotation annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** + * Creates a new ImageClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationAnnotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation): google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation; + + /** + * Encodes the specified ImageClassificationAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.verify|verify} messages. + * @param message ImageClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.verify|verify} messages. + * @param message ImageClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation; + + /** + * Decodes an ImageClassificationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation; + + /** + * Verifies an ImageClassificationAnnotation message. + * @param message Plain 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 ImageClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation; + + /** + * Creates a plain object from an ImageClassificationAnnotation message. Also converts values to other types if specified. + * @param message ImageClassificationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Vertex. */ + interface IVertex { + + /** Vertex x */ + x?: (number|null); + + /** Vertex y */ + y?: (number|null); + } + + /** Represents a Vertex. */ + class Vertex implements IVertex { + + /** + * Constructs a new Vertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IVertex); + + /** Vertex x. */ + public x: number; + + /** Vertex y. */ + public y: number; + + /** + * Creates a new Vertex instance using the specified properties. + * @param [properties] Properties to set + * @returns Vertex instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IVertex): google.cloud.datalabeling.v1beta1.Vertex; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.Vertex; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.Vertex; + + /** + * Verifies a Vertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.Vertex; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @param message Vertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.Vertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Vertex + * @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.datalabeling.v1beta1.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.datalabeling.v1beta1.INormalizedVertex): google.cloud.datalabeling.v1beta1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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 BoundingPoly. */ + interface IBoundingPoly { + + /** BoundingPoly vertices */ + vertices?: (google.cloud.datalabeling.v1beta1.IVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IBoundingPoly); + + /** BoundingPoly vertices. */ + public vertices: google.cloud.datalabeling.v1beta1.IVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IBoundingPoly): google.cloud.datalabeling.v1beta1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.BoundingPoly; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.BoundingPoly; + + /** + * Verifies a BoundingPoly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingPoly + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.BoundingPoly; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @param message BoundingPoly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingPoly + * @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 normalizedVertices */ + normalizedVertices?: (google.cloud.datalabeling.v1beta1.INormalizedVertex[]|null); + } + + /** Represents a NormalizedBoundingPoly. */ + class NormalizedBoundingPoly implements INormalizedBoundingPoly { + + /** + * Constructs a new NormalizedBoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly); + + /** NormalizedBoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.datalabeling.v1beta1.INormalizedVertex[]; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingPoly instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly): google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.INormalizedBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingPoly message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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 an ImageBoundingPolyAnnotation. */ + interface IImageBoundingPolyAnnotation { + + /** ImageBoundingPolyAnnotation boundingPoly */ + boundingPoly?: (google.cloud.datalabeling.v1beta1.IBoundingPoly|null); + + /** ImageBoundingPolyAnnotation normalizedBoundingPoly */ + normalizedBoundingPoly?: (google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly|null); + + /** ImageBoundingPolyAnnotation annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + } + + /** Represents an ImageBoundingPolyAnnotation. */ + class ImageBoundingPolyAnnotation implements IImageBoundingPolyAnnotation { + + /** + * Constructs a new ImageBoundingPolyAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation); + + /** ImageBoundingPolyAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.datalabeling.v1beta1.IBoundingPoly|null); + + /** ImageBoundingPolyAnnotation normalizedBoundingPoly. */ + public normalizedBoundingPoly?: (google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly|null); + + /** ImageBoundingPolyAnnotation annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** ImageBoundingPolyAnnotation boundedArea. */ + public boundedArea?: ("boundingPoly"|"normalizedBoundingPoly"); + + /** + * Creates a new ImageBoundingPolyAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageBoundingPolyAnnotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation): google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation; + + /** + * Encodes the specified ImageBoundingPolyAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.verify|verify} messages. + * @param message ImageBoundingPolyAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageBoundingPolyAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.verify|verify} messages. + * @param message ImageBoundingPolyAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageBoundingPolyAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageBoundingPolyAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation; + + /** + * Decodes an ImageBoundingPolyAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageBoundingPolyAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation; + + /** + * Verifies an ImageBoundingPolyAnnotation message. + * @param message Plain 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 ImageBoundingPolyAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageBoundingPolyAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation; + + /** + * Creates a plain object from an ImageBoundingPolyAnnotation message. Also converts values to other types if specified. + * @param message ImageBoundingPolyAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageBoundingPolyAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageBoundingPolyAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Polyline. */ + interface IPolyline { + + /** Polyline vertices */ + vertices?: (google.cloud.datalabeling.v1beta1.IVertex[]|null); + } + + /** Represents a Polyline. */ + class Polyline implements IPolyline { + + /** + * Constructs a new Polyline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IPolyline); + + /** Polyline vertices. */ + public vertices: google.cloud.datalabeling.v1beta1.IVertex[]; + + /** + * Creates a new Polyline instance using the specified properties. + * @param [properties] Properties to set + * @returns Polyline instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IPolyline): google.cloud.datalabeling.v1beta1.Polyline; + + /** + * Encodes the specified Polyline message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Polyline.verify|verify} messages. + * @param message Polyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Polyline.verify|verify} messages. + * @param message Polyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Polyline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.Polyline; + + /** + * Decodes a Polyline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.Polyline; + + /** + * Verifies a Polyline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Polyline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Polyline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.Polyline; + + /** + * Creates a plain object from a Polyline message. Also converts values to other types if specified. + * @param message Polyline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.Polyline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Polyline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Polyline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedPolyline. */ + interface INormalizedPolyline { + + /** NormalizedPolyline normalizedVertices */ + normalizedVertices?: (google.cloud.datalabeling.v1beta1.INormalizedVertex[]|null); + } + + /** Represents a NormalizedPolyline. */ + class NormalizedPolyline implements INormalizedPolyline { + + /** + * Constructs a new NormalizedPolyline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.INormalizedPolyline); + + /** NormalizedPolyline normalizedVertices. */ + public normalizedVertices: google.cloud.datalabeling.v1beta1.INormalizedVertex[]; + + /** + * Creates a new NormalizedPolyline instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedPolyline instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.INormalizedPolyline): google.cloud.datalabeling.v1beta1.NormalizedPolyline; + + /** + * Encodes the specified NormalizedPolyline message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.NormalizedPolyline.verify|verify} messages. + * @param message NormalizedPolyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.INormalizedPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedPolyline message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.NormalizedPolyline.verify|verify} messages. + * @param message NormalizedPolyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.INormalizedPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedPolyline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.NormalizedPolyline; + + /** + * Decodes a NormalizedPolyline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.NormalizedPolyline; + + /** + * Verifies a NormalizedPolyline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedPolyline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedPolyline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.NormalizedPolyline; + + /** + * Creates a plain object from a NormalizedPolyline message. Also converts values to other types if specified. + * @param message NormalizedPolyline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.NormalizedPolyline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedPolyline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedPolyline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImagePolylineAnnotation. */ + interface IImagePolylineAnnotation { + + /** ImagePolylineAnnotation polyline */ + polyline?: (google.cloud.datalabeling.v1beta1.IPolyline|null); + + /** ImagePolylineAnnotation normalizedPolyline */ + normalizedPolyline?: (google.cloud.datalabeling.v1beta1.INormalizedPolyline|null); + + /** ImagePolylineAnnotation annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + } + + /** Represents an ImagePolylineAnnotation. */ + class ImagePolylineAnnotation implements IImagePolylineAnnotation { + + /** + * Constructs a new ImagePolylineAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation); + + /** ImagePolylineAnnotation polyline. */ + public polyline?: (google.cloud.datalabeling.v1beta1.IPolyline|null); + + /** ImagePolylineAnnotation normalizedPolyline. */ + public normalizedPolyline?: (google.cloud.datalabeling.v1beta1.INormalizedPolyline|null); + + /** ImagePolylineAnnotation annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** ImagePolylineAnnotation poly. */ + public poly?: ("polyline"|"normalizedPolyline"); + + /** + * Creates a new ImagePolylineAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImagePolylineAnnotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation): google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation; + + /** + * Encodes the specified ImagePolylineAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.verify|verify} messages. + * @param message ImagePolylineAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImagePolylineAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.verify|verify} messages. + * @param message ImagePolylineAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImagePolylineAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImagePolylineAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation; + + /** + * Decodes an ImagePolylineAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImagePolylineAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation; + + /** + * Verifies an ImagePolylineAnnotation message. + * @param message Plain 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 ImagePolylineAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImagePolylineAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation; + + /** + * Creates a plain object from an ImagePolylineAnnotation message. Also converts values to other types if specified. + * @param message ImagePolylineAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImagePolylineAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImagePolylineAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageSegmentationAnnotation. */ + interface IImageSegmentationAnnotation { + + /** ImageSegmentationAnnotation annotationColors */ + annotationColors?: ({ [k: string]: google.cloud.datalabeling.v1beta1.IAnnotationSpec }|null); + + /** ImageSegmentationAnnotation mimeType */ + mimeType?: (string|null); + + /** ImageSegmentationAnnotation imageBytes */ + imageBytes?: (Uint8Array|string|null); + } + + /** Represents an ImageSegmentationAnnotation. */ + class ImageSegmentationAnnotation implements IImageSegmentationAnnotation { + + /** + * Constructs a new ImageSegmentationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation); + + /** ImageSegmentationAnnotation annotationColors. */ + public annotationColors: { [k: string]: google.cloud.datalabeling.v1beta1.IAnnotationSpec }; + + /** ImageSegmentationAnnotation mimeType. */ + public mimeType: string; + + /** ImageSegmentationAnnotation imageBytes. */ + public imageBytes: (Uint8Array|string); + + /** + * Creates a new ImageSegmentationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageSegmentationAnnotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation): google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation; + + /** + * Encodes the specified ImageSegmentationAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.verify|verify} messages. + * @param message ImageSegmentationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageSegmentationAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.verify|verify} messages. + * @param message ImageSegmentationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageSegmentationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageSegmentationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation; + + /** + * Decodes an ImageSegmentationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageSegmentationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation; + + /** + * Verifies an ImageSegmentationAnnotation message. + * @param message Plain 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 ImageSegmentationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageSegmentationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation; + + /** + * Creates a plain object from an ImageSegmentationAnnotation message. Also converts values to other types if specified. + * @param message ImageSegmentationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageSegmentationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageSegmentationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationAnnotation. */ + interface ITextClassificationAnnotation { + + /** TextClassificationAnnotation annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + } + + /** Represents a TextClassificationAnnotation. */ + class TextClassificationAnnotation implements ITextClassificationAnnotation { + + /** + * Constructs a new TextClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation); + + /** TextClassificationAnnotation annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** + * Creates a new TextClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationAnnotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation): google.cloud.datalabeling.v1beta1.TextClassificationAnnotation; + + /** + * Encodes the specified TextClassificationAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.verify|verify} messages. + * @param message TextClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.verify|verify} messages. + * @param message TextClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.TextClassificationAnnotation; + + /** + * Decodes a TextClassificationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.TextClassificationAnnotation; + + /** + * Verifies a TextClassificationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.TextClassificationAnnotation; + + /** + * Creates a plain object from a TextClassificationAnnotation message. Also converts values to other types if specified. + * @param message TextClassificationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.TextClassificationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextEntityExtractionAnnotation. */ + interface ITextEntityExtractionAnnotation { + + /** TextEntityExtractionAnnotation annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** TextEntityExtractionAnnotation sequentialSegment */ + sequentialSegment?: (google.cloud.datalabeling.v1beta1.ISequentialSegment|null); + } + + /** Represents a TextEntityExtractionAnnotation. */ + class TextEntityExtractionAnnotation implements ITextEntityExtractionAnnotation { + + /** + * Constructs a new TextEntityExtractionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation); + + /** TextEntityExtractionAnnotation annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** TextEntityExtractionAnnotation sequentialSegment. */ + public sequentialSegment?: (google.cloud.datalabeling.v1beta1.ISequentialSegment|null); + + /** + * Creates a new TextEntityExtractionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextEntityExtractionAnnotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation): google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation; + + /** + * Encodes the specified TextEntityExtractionAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.verify|verify} messages. + * @param message TextEntityExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextEntityExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.verify|verify} messages. + * @param message TextEntityExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextEntityExtractionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextEntityExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation; + + /** + * Decodes a TextEntityExtractionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextEntityExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation; + + /** + * Verifies a TextEntityExtractionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextEntityExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextEntityExtractionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation; + + /** + * Creates a plain object from a TextEntityExtractionAnnotation message. Also converts values to other types if specified. + * @param message TextEntityExtractionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextEntityExtractionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextEntityExtractionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SequentialSegment. */ + interface ISequentialSegment { + + /** SequentialSegment start */ + start?: (number|null); + + /** SequentialSegment end */ + end?: (number|null); + } + + /** Represents a SequentialSegment. */ + class SequentialSegment implements ISequentialSegment { + + /** + * Constructs a new SequentialSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ISequentialSegment); + + /** SequentialSegment start. */ + public start: number; + + /** SequentialSegment end. */ + public end: number; + + /** + * Creates a new SequentialSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns SequentialSegment instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ISequentialSegment): google.cloud.datalabeling.v1beta1.SequentialSegment; + + /** + * Encodes the specified SequentialSegment message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SequentialSegment.verify|verify} messages. + * @param message SequentialSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ISequentialSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SequentialSegment message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SequentialSegment.verify|verify} messages. + * @param message SequentialSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ISequentialSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SequentialSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SequentialSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.SequentialSegment; + + /** + * Decodes a SequentialSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SequentialSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.SequentialSegment; + + /** + * Verifies a SequentialSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SequentialSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SequentialSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.SequentialSegment; + + /** + * Creates a plain object from a SequentialSegment message. Also converts values to other types if specified. + * @param message SequentialSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.SequentialSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SequentialSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SequentialSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeSegment. */ + interface ITimeSegment { + + /** TimeSegment startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + + /** TimeSegment endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a TimeSegment. */ + class TimeSegment implements ITimeSegment { + + /** + * Constructs a new TimeSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ITimeSegment); + + /** TimeSegment startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** TimeSegment endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new TimeSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSegment instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ITimeSegment): google.cloud.datalabeling.v1beta1.TimeSegment; + + /** + * Encodes the specified TimeSegment message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TimeSegment.verify|verify} messages. + * @param message TimeSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ITimeSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSegment message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TimeSegment.verify|verify} messages. + * @param message TimeSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ITimeSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.TimeSegment; + + /** + * Decodes a TimeSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.TimeSegment; + + /** + * Verifies a TimeSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.TimeSegment; + + /** + * Creates a plain object from a TimeSegment message. Also converts values to other types if specified. + * @param message TimeSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.TimeSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoClassificationAnnotation. */ + interface IVideoClassificationAnnotation { + + /** VideoClassificationAnnotation timeSegment */ + timeSegment?: (google.cloud.datalabeling.v1beta1.ITimeSegment|null); + + /** VideoClassificationAnnotation annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + } + + /** Represents a VideoClassificationAnnotation. */ + class VideoClassificationAnnotation implements IVideoClassificationAnnotation { + + /** + * Constructs a new VideoClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation); + + /** VideoClassificationAnnotation timeSegment. */ + public timeSegment?: (google.cloud.datalabeling.v1beta1.ITimeSegment|null); + + /** VideoClassificationAnnotation annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** + * Creates a new VideoClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoClassificationAnnotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation): google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation; + + /** + * Encodes the specified VideoClassificationAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @param message VideoClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @param message VideoClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoClassificationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation; + + /** + * Decodes a VideoClassificationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation; + + /** + * Verifies a VideoClassificationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoClassificationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation; + + /** + * Creates a plain object from a VideoClassificationAnnotation message. Also converts values to other types if specified. + * @param message VideoClassificationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoClassificationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoClassificationAnnotation + * @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 boundingPoly */ + boundingPoly?: (google.cloud.datalabeling.v1beta1.IBoundingPoly|null); + + /** ObjectTrackingFrame normalizedBoundingPoly */ + normalizedBoundingPoly?: (google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly|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.datalabeling.v1beta1.IObjectTrackingFrame); + + /** ObjectTrackingFrame boundingPoly. */ + public boundingPoly?: (google.cloud.datalabeling.v1beta1.IBoundingPoly|null); + + /** ObjectTrackingFrame normalizedBoundingPoly. */ + public normalizedBoundingPoly?: (google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly|null); + + /** ObjectTrackingFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** ObjectTrackingFrame boundedArea. */ + public boundedArea?: ("boundingPoly"|"normalizedBoundingPoly"); + + /** + * Creates a new ObjectTrackingFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingFrame instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IObjectTrackingFrame): google.cloud.datalabeling.v1beta1.ObjectTrackingFrame; + + /** + * Encodes the specified ObjectTrackingFrame message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.IObjectTrackingFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingFrame message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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 a VideoObjectTrackingAnnotation. */ + interface IVideoObjectTrackingAnnotation { + + /** VideoObjectTrackingAnnotation annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** VideoObjectTrackingAnnotation timeSegment */ + timeSegment?: (google.cloud.datalabeling.v1beta1.ITimeSegment|null); + + /** VideoObjectTrackingAnnotation objectTrackingFrames */ + objectTrackingFrames?: (google.cloud.datalabeling.v1beta1.IObjectTrackingFrame[]|null); + } + + /** Represents a VideoObjectTrackingAnnotation. */ + class VideoObjectTrackingAnnotation implements IVideoObjectTrackingAnnotation { + + /** + * Constructs a new VideoObjectTrackingAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation); + + /** VideoObjectTrackingAnnotation annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** VideoObjectTrackingAnnotation timeSegment. */ + public timeSegment?: (google.cloud.datalabeling.v1beta1.ITimeSegment|null); + + /** VideoObjectTrackingAnnotation objectTrackingFrames. */ + public objectTrackingFrames: google.cloud.datalabeling.v1beta1.IObjectTrackingFrame[]; + + /** + * Creates a new VideoObjectTrackingAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingAnnotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation): google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @param message VideoObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @param message VideoObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoObjectTrackingAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation; + + /** + * Decodes a VideoObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation; + + /** + * Verifies a VideoObjectTrackingAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoObjectTrackingAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation; + + /** + * Creates a plain object from a VideoObjectTrackingAnnotation message. Also converts values to other types if specified. + * @param message VideoObjectTrackingAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoObjectTrackingAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoObjectTrackingAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoEventAnnotation. */ + interface IVideoEventAnnotation { + + /** VideoEventAnnotation annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** VideoEventAnnotation timeSegment */ + timeSegment?: (google.cloud.datalabeling.v1beta1.ITimeSegment|null); + } + + /** Represents a VideoEventAnnotation. */ + class VideoEventAnnotation implements IVideoEventAnnotation { + + /** + * Constructs a new VideoEventAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IVideoEventAnnotation); + + /** VideoEventAnnotation annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** VideoEventAnnotation timeSegment. */ + public timeSegment?: (google.cloud.datalabeling.v1beta1.ITimeSegment|null); + + /** + * Creates a new VideoEventAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoEventAnnotation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IVideoEventAnnotation): google.cloud.datalabeling.v1beta1.VideoEventAnnotation; + + /** + * Encodes the specified VideoEventAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoEventAnnotation.verify|verify} messages. + * @param message VideoEventAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IVideoEventAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoEventAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoEventAnnotation.verify|verify} messages. + * @param message VideoEventAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IVideoEventAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoEventAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoEventAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.VideoEventAnnotation; + + /** + * Decodes a VideoEventAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoEventAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.VideoEventAnnotation; + + /** + * Verifies a VideoEventAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoEventAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoEventAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.VideoEventAnnotation; + + /** + * Creates a plain object from a VideoEventAnnotation message. Also converts values to other types if specified. + * @param message VideoEventAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.VideoEventAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoEventAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoEventAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotationMetadata. */ + interface IAnnotationMetadata { + + /** AnnotationMetadata operatorMetadata */ + operatorMetadata?: (google.cloud.datalabeling.v1beta1.IOperatorMetadata|null); + } + + /** Represents an AnnotationMetadata. */ + class AnnotationMetadata implements IAnnotationMetadata { + + /** + * Constructs a new AnnotationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IAnnotationMetadata); + + /** AnnotationMetadata operatorMetadata. */ + public operatorMetadata?: (google.cloud.datalabeling.v1beta1.IOperatorMetadata|null); + + /** + * Creates a new AnnotationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IAnnotationMetadata): google.cloud.datalabeling.v1beta1.AnnotationMetadata; + + /** + * Encodes the specified AnnotationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationMetadata.verify|verify} messages. + * @param message AnnotationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IAnnotationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationMetadata.verify|verify} messages. + * @param message AnnotationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IAnnotationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.AnnotationMetadata; + + /** + * Decodes an AnnotationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.AnnotationMetadata; + + /** + * Verifies an AnnotationMetadata message. + * @param message Plain 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 AnnotationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.AnnotationMetadata; + + /** + * Creates a plain object from an AnnotationMetadata message. Also converts values to other types if specified. + * @param message AnnotationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.AnnotationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperatorMetadata. */ + interface IOperatorMetadata { + + /** OperatorMetadata score */ + score?: (number|null); + + /** OperatorMetadata totalVotes */ + totalVotes?: (number|null); + + /** OperatorMetadata labelVotes */ + labelVotes?: (number|null); + + /** OperatorMetadata comments */ + comments?: (string[]|null); + } + + /** Represents an OperatorMetadata. */ + class OperatorMetadata implements IOperatorMetadata { + + /** + * Constructs a new OperatorMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IOperatorMetadata); + + /** OperatorMetadata score. */ + public score: number; + + /** OperatorMetadata totalVotes. */ + public totalVotes: number; + + /** OperatorMetadata labelVotes. */ + public labelVotes: number; + + /** OperatorMetadata comments. */ + public comments: string[]; + + /** + * Creates a new OperatorMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperatorMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IOperatorMetadata): google.cloud.datalabeling.v1beta1.OperatorMetadata; + + /** + * Encodes the specified OperatorMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.OperatorMetadata.verify|verify} messages. + * @param message OperatorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IOperatorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperatorMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.OperatorMetadata.verify|verify} messages. + * @param message OperatorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IOperatorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperatorMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperatorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.OperatorMetadata; + + /** + * Decodes an OperatorMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperatorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.OperatorMetadata; + + /** + * Verifies an OperatorMetadata message. + * @param message Plain 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 OperatorMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperatorMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.OperatorMetadata; + + /** + * Creates a plain object from an OperatorMetadata message. Also converts values to other types if specified. + * @param message OperatorMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.OperatorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperatorMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperatorMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotationSpecSet. */ + interface IAnnotationSpecSet { + + /** AnnotationSpecSet name */ + name?: (string|null); + + /** AnnotationSpecSet displayName */ + displayName?: (string|null); + + /** AnnotationSpecSet description */ + description?: (string|null); + + /** AnnotationSpecSet annotationSpecs */ + annotationSpecs?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec[]|null); + + /** AnnotationSpecSet blockingResources */ + blockingResources?: (string[]|null); + } + + /** Represents an AnnotationSpecSet. */ + class AnnotationSpecSet implements IAnnotationSpecSet { + + /** + * Constructs a new AnnotationSpecSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IAnnotationSpecSet); + + /** AnnotationSpecSet name. */ + public name: string; + + /** AnnotationSpecSet displayName. */ + public displayName: string; + + /** AnnotationSpecSet description. */ + public description: string; + + /** AnnotationSpecSet annotationSpecs. */ + public annotationSpecs: google.cloud.datalabeling.v1beta1.IAnnotationSpec[]; + + /** AnnotationSpecSet blockingResources. */ + public blockingResources: string[]; + + /** + * Creates a new AnnotationSpecSet instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationSpecSet instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IAnnotationSpecSet): google.cloud.datalabeling.v1beta1.AnnotationSpecSet; + + /** + * Encodes the specified AnnotationSpecSet message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationSpecSet.verify|verify} messages. + * @param message AnnotationSpecSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationSpecSet message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationSpecSet.verify|verify} messages. + * @param message AnnotationSpecSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationSpecSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationSpecSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.AnnotationSpecSet; + + /** + * Decodes an AnnotationSpecSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationSpecSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.AnnotationSpecSet; + + /** + * Verifies an AnnotationSpecSet message. + * @param message Plain 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 AnnotationSpecSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationSpecSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.AnnotationSpecSet; + + /** + * Creates a plain object from an AnnotationSpecSet message. Also converts values to other types if specified. + * @param message AnnotationSpecSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.AnnotationSpecSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationSpecSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationSpecSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotationSpec. */ + interface IAnnotationSpec { + + /** AnnotationSpec displayName */ + displayName?: (string|null); + + /** AnnotationSpec description */ + description?: (string|null); + } + + /** Represents an AnnotationSpec. */ + class AnnotationSpec implements IAnnotationSpec { + + /** + * Constructs a new AnnotationSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IAnnotationSpec); + + /** AnnotationSpec displayName. */ + public displayName: string; + + /** AnnotationSpec description. */ + public description: string; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationSpec instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IAnnotationSpec): google.cloud.datalabeling.v1beta1.AnnotationSpec; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationSpec.verify|verify} messages. + * @param message AnnotationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationSpec.verify|verify} messages. + * @param message AnnotationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.AnnotationSpec; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.AnnotationSpec; + + /** + * Verifies an AnnotationSpec message. + * @param message Plain 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 AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.AnnotationSpec; + + /** + * Creates a plain object from an AnnotationSpec message. Also converts values to other types if specified. + * @param message AnnotationSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.AnnotationSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DataLabelingService */ + class DataLabelingService extends $protobuf.rpc.Service { + + /** + * Constructs a new DataLabelingService 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 DataLabelingService 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): DataLabelingService; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public createDataset(request: google.cloud.datalabeling.v1beta1.ICreateDatasetRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.CreateDatasetCallback): void; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @returns Promise + */ + public createDataset(request: google.cloud.datalabeling.v1beta1.ICreateDatasetRequest): Promise; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public getDataset(request: google.cloud.datalabeling.v1beta1.IGetDatasetRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.GetDatasetCallback): void; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @returns Promise + */ + public getDataset(request: google.cloud.datalabeling.v1beta1.IGetDatasetRequest): Promise; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatasetsResponse + */ + public listDatasets(request: google.cloud.datalabeling.v1beta1.IListDatasetsRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ListDatasetsCallback): void; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @returns Promise + */ + public listDatasets(request: google.cloud.datalabeling.v1beta1.IListDatasetsRequest): Promise; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDataset(request: google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteDatasetCallback): void; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @returns Promise + */ + public deleteDataset(request: google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest): Promise; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importData(request: google.cloud.datalabeling.v1beta1.IImportDataRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ImportDataCallback): void; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @returns Promise + */ + public importData(request: google.cloud.datalabeling.v1beta1.IImportDataRequest): Promise; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportData(request: google.cloud.datalabeling.v1beta1.IExportDataRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ExportDataCallback): void; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @returns Promise + */ + public exportData(request: google.cloud.datalabeling.v1beta1.IExportDataRequest): Promise; + + /** + * Calls GetDataItem. + * @param request GetDataItemRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataItem + */ + public getDataItem(request: google.cloud.datalabeling.v1beta1.IGetDataItemRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataItemCallback): void; + + /** + * Calls GetDataItem. + * @param request GetDataItemRequest message or plain object + * @returns Promise + */ + public getDataItem(request: google.cloud.datalabeling.v1beta1.IGetDataItemRequest): Promise; + + /** + * Calls ListDataItems. + * @param request ListDataItemsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataItemsResponse + */ + public listDataItems(request: google.cloud.datalabeling.v1beta1.IListDataItemsRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ListDataItemsCallback): void; + + /** + * Calls ListDataItems. + * @param request ListDataItemsRequest message or plain object + * @returns Promise + */ + public listDataItems(request: google.cloud.datalabeling.v1beta1.IListDataItemsRequest): Promise; + + /** + * Calls GetAnnotatedDataset. + * @param request GetAnnotatedDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotatedDataset + */ + public getAnnotatedDataset(request: google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotatedDatasetCallback): void; + + /** + * Calls GetAnnotatedDataset. + * @param request GetAnnotatedDatasetRequest message or plain object + * @returns Promise + */ + public getAnnotatedDataset(request: google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest): Promise; + + /** + * Calls ListAnnotatedDatasets. + * @param request ListAnnotatedDatasetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAnnotatedDatasetsResponse + */ + public listAnnotatedDatasets(request: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotatedDatasetsCallback): void; + + /** + * Calls ListAnnotatedDatasets. + * @param request ListAnnotatedDatasetsRequest message or plain object + * @returns Promise + */ + public listAnnotatedDatasets(request: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest): Promise; + + /** + * Calls DeleteAnnotatedDataset. + * @param request DeleteAnnotatedDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAnnotatedDataset(request: google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotatedDatasetCallback): void; + + /** + * Calls DeleteAnnotatedDataset. + * @param request DeleteAnnotatedDatasetRequest message or plain object + * @returns Promise + */ + public deleteAnnotatedDataset(request: google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest): Promise; + + /** + * Calls LabelImage. + * @param request LabelImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public labelImage(request: google.cloud.datalabeling.v1beta1.ILabelImageRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.LabelImageCallback): void; + + /** + * Calls LabelImage. + * @param request LabelImageRequest message or plain object + * @returns Promise + */ + public labelImage(request: google.cloud.datalabeling.v1beta1.ILabelImageRequest): Promise; + + /** + * Calls LabelVideo. + * @param request LabelVideoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public labelVideo(request: google.cloud.datalabeling.v1beta1.ILabelVideoRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.LabelVideoCallback): void; + + /** + * Calls LabelVideo. + * @param request LabelVideoRequest message or plain object + * @returns Promise + */ + public labelVideo(request: google.cloud.datalabeling.v1beta1.ILabelVideoRequest): Promise; + + /** + * Calls LabelText. + * @param request LabelTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public labelText(request: google.cloud.datalabeling.v1beta1.ILabelTextRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.LabelTextCallback): void; + + /** + * Calls LabelText. + * @param request LabelTextRequest message or plain object + * @returns Promise + */ + public labelText(request: google.cloud.datalabeling.v1beta1.ILabelTextRequest): Promise; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public getExample(request: google.cloud.datalabeling.v1beta1.IGetExampleRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.GetExampleCallback): void; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @returns Promise + */ + public getExample(request: google.cloud.datalabeling.v1beta1.IGetExampleRequest): Promise; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExamplesResponse + */ + public listExamples(request: google.cloud.datalabeling.v1beta1.IListExamplesRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ListExamplesCallback): void; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @returns Promise + */ + public listExamples(request: google.cloud.datalabeling.v1beta1.IListExamplesRequest): Promise; + + /** + * Calls CreateAnnotationSpecSet. + * @param request CreateAnnotationSpecSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotationSpecSet + */ + public createAnnotationSpecSet(request: google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.CreateAnnotationSpecSetCallback): void; + + /** + * Calls CreateAnnotationSpecSet. + * @param request CreateAnnotationSpecSetRequest message or plain object + * @returns Promise + */ + public createAnnotationSpecSet(request: google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest): Promise; + + /** + * Calls GetAnnotationSpecSet. + * @param request GetAnnotationSpecSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotationSpecSet + */ + public getAnnotationSpecSet(request: google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotationSpecSetCallback): void; + + /** + * Calls GetAnnotationSpecSet. + * @param request GetAnnotationSpecSetRequest message or plain object + * @returns Promise + */ + public getAnnotationSpecSet(request: google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest): Promise; + + /** + * Calls ListAnnotationSpecSets. + * @param request ListAnnotationSpecSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAnnotationSpecSetsResponse + */ + public listAnnotationSpecSets(request: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotationSpecSetsCallback): void; + + /** + * Calls ListAnnotationSpecSets. + * @param request ListAnnotationSpecSetsRequest message or plain object + * @returns Promise + */ + public listAnnotationSpecSets(request: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest): Promise; + + /** + * Calls DeleteAnnotationSpecSet. + * @param request DeleteAnnotationSpecSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAnnotationSpecSet(request: google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotationSpecSetCallback): void; + + /** + * Calls DeleteAnnotationSpecSet. + * @param request DeleteAnnotationSpecSetRequest message or plain object + * @returns Promise + */ + public deleteAnnotationSpecSet(request: google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest): Promise; + + /** + * Calls CreateInstruction. + * @param request CreateInstructionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstruction(request: google.cloud.datalabeling.v1beta1.ICreateInstructionRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.CreateInstructionCallback): void; + + /** + * Calls CreateInstruction. + * @param request CreateInstructionRequest message or plain object + * @returns Promise + */ + public createInstruction(request: google.cloud.datalabeling.v1beta1.ICreateInstructionRequest): Promise; + + /** + * Calls GetInstruction. + * @param request GetInstructionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instruction + */ + public getInstruction(request: google.cloud.datalabeling.v1beta1.IGetInstructionRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.GetInstructionCallback): void; + + /** + * Calls GetInstruction. + * @param request GetInstructionRequest message or plain object + * @returns Promise + */ + public getInstruction(request: google.cloud.datalabeling.v1beta1.IGetInstructionRequest): Promise; + + /** + * Calls ListInstructions. + * @param request ListInstructionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstructionsResponse + */ + public listInstructions(request: google.cloud.datalabeling.v1beta1.IListInstructionsRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ListInstructionsCallback): void; + + /** + * Calls ListInstructions. + * @param request ListInstructionsRequest message or plain object + * @returns Promise + */ + public listInstructions(request: google.cloud.datalabeling.v1beta1.IListInstructionsRequest): Promise; + + /** + * Calls DeleteInstruction. + * @param request DeleteInstructionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteInstruction(request: google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteInstructionCallback): void; + + /** + * Calls DeleteInstruction. + * @param request DeleteInstructionRequest message or plain object + * @returns Promise + */ + public deleteInstruction(request: google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest): Promise; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Evaluation + */ + public getEvaluation(request: google.cloud.datalabeling.v1beta1.IGetEvaluationRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluationCallback): void; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @returns Promise + */ + public getEvaluation(request: google.cloud.datalabeling.v1beta1.IGetEvaluationRequest): Promise; + + /** + * Calls SearchEvaluations. + * @param request SearchEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchEvaluationsResponse + */ + public searchEvaluations(request: google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluationsCallback): void; + + /** + * Calls SearchEvaluations. + * @param request SearchEvaluationsRequest message or plain object + * @returns Promise + */ + public searchEvaluations(request: google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest): Promise; + + /** + * Calls SearchExampleComparisons. + * @param request SearchExampleComparisonsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchExampleComparisonsResponse + */ + public searchExampleComparisons(request: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.SearchExampleComparisonsCallback): void; + + /** + * Calls SearchExampleComparisons. + * @param request SearchExampleComparisonsRequest message or plain object + * @returns Promise + */ + public searchExampleComparisons(request: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest): Promise; + + /** + * Calls CreateEvaluationJob. + * @param request CreateEvaluationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationJob + */ + public createEvaluationJob(request: google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.CreateEvaluationJobCallback): void; + + /** + * Calls CreateEvaluationJob. + * @param request CreateEvaluationJobRequest message or plain object + * @returns Promise + */ + public createEvaluationJob(request: google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest): Promise; + + /** + * Calls UpdateEvaluationJob. + * @param request UpdateEvaluationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationJob + */ + public updateEvaluationJob(request: google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.UpdateEvaluationJobCallback): void; + + /** + * Calls UpdateEvaluationJob. + * @param request UpdateEvaluationJobRequest message or plain object + * @returns Promise + */ + public updateEvaluationJob(request: google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest): Promise; + + /** + * Calls GetEvaluationJob. + * @param request GetEvaluationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationJob + */ + public getEvaluationJob(request: google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluationJobCallback): void; + + /** + * Calls GetEvaluationJob. + * @param request GetEvaluationJobRequest message or plain object + * @returns Promise + */ + public getEvaluationJob(request: google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest): Promise; + + /** + * Calls PauseEvaluationJob. + * @param request PauseEvaluationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public pauseEvaluationJob(request: google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.PauseEvaluationJobCallback): void; + + /** + * Calls PauseEvaluationJob. + * @param request PauseEvaluationJobRequest message or plain object + * @returns Promise + */ + public pauseEvaluationJob(request: google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest): Promise; + + /** + * Calls ResumeEvaluationJob. + * @param request ResumeEvaluationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public resumeEvaluationJob(request: google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ResumeEvaluationJobCallback): void; + + /** + * Calls ResumeEvaluationJob. + * @param request ResumeEvaluationJobRequest message or plain object + * @returns Promise + */ + public resumeEvaluationJob(request: google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest): Promise; + + /** + * Calls DeleteEvaluationJob. + * @param request DeleteEvaluationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvaluationJob(request: google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteEvaluationJobCallback): void; + + /** + * Calls DeleteEvaluationJob. + * @param request DeleteEvaluationJobRequest message or plain object + * @returns Promise + */ + public deleteEvaluationJob(request: google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest): Promise; + + /** + * Calls ListEvaluationJobs. + * @param request ListEvaluationJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationJobsResponse + */ + public listEvaluationJobs(request: google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, callback: google.cloud.datalabeling.v1beta1.DataLabelingService.ListEvaluationJobsCallback): void; + + /** + * Calls ListEvaluationJobs. + * @param request ListEvaluationJobsRequest message or plain object + * @returns Promise + */ + public listEvaluationJobs(request: google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest): Promise; + } + + namespace DataLabelingService { + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|createDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type CreateDatasetCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type GetDatasetCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listDatasets}. + * @param error Error, if any + * @param [response] ListDatasetsResponse + */ + type ListDatasetsCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.ListDatasetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteDataset}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDatasetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|importData}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|exportData}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getDataItem}. + * @param error Error, if any + * @param [response] DataItem + */ + type GetDataItemCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.DataItem) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listDataItems}. + * @param error Error, if any + * @param [response] ListDataItemsResponse + */ + type ListDataItemsCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.ListDataItemsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getAnnotatedDataset}. + * @param error Error, if any + * @param [response] AnnotatedDataset + */ + type GetAnnotatedDatasetCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.AnnotatedDataset) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listAnnotatedDatasets}. + * @param error Error, if any + * @param [response] ListAnnotatedDatasetsResponse + */ + type ListAnnotatedDatasetsCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteAnnotatedDataset}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAnnotatedDatasetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|labelImage}. + * @param error Error, if any + * @param [response] Operation + */ + type LabelImageCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|labelVideo}. + * @param error Error, if any + * @param [response] Operation + */ + type LabelVideoCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|labelText}. + * @param error Error, if any + * @param [response] Operation + */ + type LabelTextCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getExample}. + * @param error Error, if any + * @param [response] Example + */ + type GetExampleCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.Example) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listExamples}. + * @param error Error, if any + * @param [response] ListExamplesResponse + */ + type ListExamplesCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.ListExamplesResponse) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|createAnnotationSpecSet}. + * @param error Error, if any + * @param [response] AnnotationSpecSet + */ + type CreateAnnotationSpecSetCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.AnnotationSpecSet) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getAnnotationSpecSet}. + * @param error Error, if any + * @param [response] AnnotationSpecSet + */ + type GetAnnotationSpecSetCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.AnnotationSpecSet) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listAnnotationSpecSets}. + * @param error Error, if any + * @param [response] ListAnnotationSpecSetsResponse + */ + type ListAnnotationSpecSetsCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteAnnotationSpecSet}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAnnotationSpecSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|createInstruction}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstructionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getInstruction}. + * @param error Error, if any + * @param [response] Instruction + */ + type GetInstructionCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.Instruction) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listInstructions}. + * @param error Error, if any + * @param [response] ListInstructionsResponse + */ + type ListInstructionsCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.ListInstructionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteInstruction}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteInstructionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getEvaluation}. + * @param error Error, if any + * @param [response] Evaluation + */ + type GetEvaluationCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.Evaluation) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|searchEvaluations}. + * @param error Error, if any + * @param [response] SearchEvaluationsResponse + */ + type SearchEvaluationsCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|searchExampleComparisons}. + * @param error Error, if any + * @param [response] SearchExampleComparisonsResponse + */ + type SearchExampleComparisonsCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|createEvaluationJob}. + * @param error Error, if any + * @param [response] EvaluationJob + */ + type CreateEvaluationJobCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.EvaluationJob) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|updateEvaluationJob}. + * @param error Error, if any + * @param [response] EvaluationJob + */ + type UpdateEvaluationJobCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.EvaluationJob) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getEvaluationJob}. + * @param error Error, if any + * @param [response] EvaluationJob + */ + type GetEvaluationJobCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.EvaluationJob) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|pauseEvaluationJob}. + * @param error Error, if any + * @param [response] Empty + */ + type PauseEvaluationJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|resumeEvaluationJob}. + * @param error Error, if any + * @param [response] Empty + */ + type ResumeEvaluationJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteEvaluationJob}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEvaluationJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listEvaluationJobs}. + * @param error Error, if any + * @param [response] ListEvaluationJobsResponse + */ + type ListEvaluationJobsCallback = (error: (Error|null), response?: google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse) => void; + } + + /** Properties of a CreateDatasetRequest. */ + interface ICreateDatasetRequest { + + /** CreateDatasetRequest parent */ + parent?: (string|null); + + /** CreateDatasetRequest dataset */ + dataset?: (google.cloud.datalabeling.v1beta1.IDataset|null); + } + + /** Represents a CreateDatasetRequest. */ + class CreateDatasetRequest implements ICreateDatasetRequest { + + /** + * Constructs a new CreateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ICreateDatasetRequest); + + /** CreateDatasetRequest parent. */ + public parent: string; + + /** CreateDatasetRequest dataset. */ + public dataset?: (google.cloud.datalabeling.v1beta1.IDataset|null); + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatasetRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ICreateDatasetRequest): google.cloud.datalabeling.v1beta1.CreateDatasetRequest; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.CreateDatasetRequest; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.CreateDatasetRequest; + + /** + * Verifies a CreateDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.CreateDatasetRequest; + + /** + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * @param message CreateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.CreateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatasetRequest. */ + interface IGetDatasetRequest { + + /** GetDatasetRequest name */ + name?: (string|null); + } + + /** Represents a GetDatasetRequest. */ + class GetDatasetRequest implements IGetDatasetRequest { + + /** + * Constructs a new GetDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGetDatasetRequest); + + /** GetDatasetRequest name. */ + public name: string; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatasetRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGetDatasetRequest): google.cloud.datalabeling.v1beta1.GetDatasetRequest; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GetDatasetRequest; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GetDatasetRequest; + + /** + * Verifies a GetDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GetDatasetRequest; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @param message GetDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GetDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatasetsRequest. */ + interface IListDatasetsRequest { + + /** ListDatasetsRequest parent */ + parent?: (string|null); + + /** ListDatasetsRequest filter */ + filter?: (string|null); + + /** ListDatasetsRequest pageSize */ + pageSize?: (number|null); + + /** ListDatasetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatasetsRequest. */ + class ListDatasetsRequest implements IListDatasetsRequest { + + /** + * Constructs a new ListDatasetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListDatasetsRequest); + + /** ListDatasetsRequest parent. */ + public parent: string; + + /** ListDatasetsRequest filter. */ + public filter: string; + + /** ListDatasetsRequest pageSize. */ + public pageSize: number; + + /** ListDatasetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatasetsRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListDatasetsRequest): google.cloud.datalabeling.v1beta1.ListDatasetsRequest; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListDatasetsRequest; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListDatasetsRequest; + + /** + * Verifies a ListDatasetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatasetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListDatasetsRequest; + + /** + * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. + * @param message ListDatasetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatasetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatasetsResponse. */ + interface IListDatasetsResponse { + + /** ListDatasetsResponse datasets */ + datasets?: (google.cloud.datalabeling.v1beta1.IDataset[]|null); + + /** ListDatasetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatasetsResponse. */ + class ListDatasetsResponse implements IListDatasetsResponse { + + /** + * Constructs a new ListDatasetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListDatasetsResponse); + + /** ListDatasetsResponse datasets. */ + public datasets: google.cloud.datalabeling.v1beta1.IDataset[]; + + /** ListDatasetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatasetsResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListDatasetsResponse): google.cloud.datalabeling.v1beta1.ListDatasetsResponse; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListDatasetsResponse; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListDatasetsResponse; + + /** + * Verifies a ListDatasetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatasetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListDatasetsResponse; + + /** + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * @param message ListDatasetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatasetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatasetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDatasetRequest. */ + interface IDeleteDatasetRequest { + + /** DeleteDatasetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDatasetRequest. */ + class DeleteDatasetRequest implements IDeleteDatasetRequest { + + /** + * Constructs a new DeleteDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest); + + /** DeleteDatasetRequest name. */ + public name: string; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDatasetRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest): google.cloud.datalabeling.v1beta1.DeleteDatasetRequest; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.DeleteDatasetRequest; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.DeleteDatasetRequest; + + /** + * Verifies a DeleteDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.DeleteDatasetRequest; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @param message DeleteDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.DeleteDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataRequest. */ + interface IImportDataRequest { + + /** ImportDataRequest name */ + name?: (string|null); + + /** ImportDataRequest inputConfig */ + inputConfig?: (google.cloud.datalabeling.v1beta1.IInputConfig|null); + + /** ImportDataRequest userEmailAddress */ + userEmailAddress?: (string|null); + } + + /** Represents an ImportDataRequest. */ + class ImportDataRequest implements IImportDataRequest { + + /** + * Constructs a new ImportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IImportDataRequest); + + /** ImportDataRequest name. */ + public name: string; + + /** ImportDataRequest inputConfig. */ + public inputConfig?: (google.cloud.datalabeling.v1beta1.IInputConfig|null); + + /** ImportDataRequest userEmailAddress. */ + public userEmailAddress: string; + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IImportDataRequest): google.cloud.datalabeling.v1beta1.ImportDataRequest; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ImportDataRequest; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ImportDataRequest; + + /** + * Verifies an ImportDataRequest message. + * @param message Plain 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 ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ImportDataRequest; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @param message ImportDataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ImportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataRequest. */ + interface IExportDataRequest { + + /** ExportDataRequest name */ + name?: (string|null); + + /** ExportDataRequest annotatedDataset */ + annotatedDataset?: (string|null); + + /** ExportDataRequest filter */ + filter?: (string|null); + + /** ExportDataRequest outputConfig */ + outputConfig?: (google.cloud.datalabeling.v1beta1.IOutputConfig|null); + + /** ExportDataRequest userEmailAddress */ + userEmailAddress?: (string|null); + } + + /** Represents an ExportDataRequest. */ + class ExportDataRequest implements IExportDataRequest { + + /** + * Constructs a new ExportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IExportDataRequest); + + /** ExportDataRequest name. */ + public name: string; + + /** ExportDataRequest annotatedDataset. */ + public annotatedDataset: string; + + /** ExportDataRequest filter. */ + public filter: string; + + /** ExportDataRequest outputConfig. */ + public outputConfig?: (google.cloud.datalabeling.v1beta1.IOutputConfig|null); + + /** ExportDataRequest userEmailAddress. */ + public userEmailAddress: string; + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IExportDataRequest): google.cloud.datalabeling.v1beta1.ExportDataRequest; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ExportDataRequest; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ExportDataRequest; + + /** + * Verifies an ExportDataRequest message. + * @param message Plain 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 ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ExportDataRequest; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @param message ExportDataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ExportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDataItemRequest. */ + interface IGetDataItemRequest { + + /** GetDataItemRequest name */ + name?: (string|null); + } + + /** Represents a GetDataItemRequest. */ + class GetDataItemRequest implements IGetDataItemRequest { + + /** + * Constructs a new GetDataItemRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGetDataItemRequest); + + /** GetDataItemRequest name. */ + public name: string; + + /** + * Creates a new GetDataItemRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataItemRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGetDataItemRequest): google.cloud.datalabeling.v1beta1.GetDataItemRequest; + + /** + * Encodes the specified GetDataItemRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetDataItemRequest.verify|verify} messages. + * @param message GetDataItemRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGetDataItemRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataItemRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetDataItemRequest.verify|verify} messages. + * @param message GetDataItemRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGetDataItemRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataItemRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataItemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GetDataItemRequest; + + /** + * Decodes a GetDataItemRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataItemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GetDataItemRequest; + + /** + * Verifies a GetDataItemRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataItemRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataItemRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GetDataItemRequest; + + /** + * Creates a plain object from a GetDataItemRequest message. Also converts values to other types if specified. + * @param message GetDataItemRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GetDataItemRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataItemRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataItemRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataItemsRequest. */ + interface IListDataItemsRequest { + + /** ListDataItemsRequest parent */ + parent?: (string|null); + + /** ListDataItemsRequest filter */ + filter?: (string|null); + + /** ListDataItemsRequest pageSize */ + pageSize?: (number|null); + + /** ListDataItemsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDataItemsRequest. */ + class ListDataItemsRequest implements IListDataItemsRequest { + + /** + * Constructs a new ListDataItemsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListDataItemsRequest); + + /** ListDataItemsRequest parent. */ + public parent: string; + + /** ListDataItemsRequest filter. */ + public filter: string; + + /** ListDataItemsRequest pageSize. */ + public pageSize: number; + + /** ListDataItemsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDataItemsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataItemsRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListDataItemsRequest): google.cloud.datalabeling.v1beta1.ListDataItemsRequest; + + /** + * Encodes the specified ListDataItemsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDataItemsRequest.verify|verify} messages. + * @param message ListDataItemsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListDataItemsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataItemsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDataItemsRequest.verify|verify} messages. + * @param message ListDataItemsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListDataItemsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataItemsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataItemsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListDataItemsRequest; + + /** + * Decodes a ListDataItemsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataItemsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListDataItemsRequest; + + /** + * Verifies a ListDataItemsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataItemsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataItemsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListDataItemsRequest; + + /** + * Creates a plain object from a ListDataItemsRequest message. Also converts values to other types if specified. + * @param message ListDataItemsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListDataItemsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataItemsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataItemsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataItemsResponse. */ + interface IListDataItemsResponse { + + /** ListDataItemsResponse dataItems */ + dataItems?: (google.cloud.datalabeling.v1beta1.IDataItem[]|null); + + /** ListDataItemsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDataItemsResponse. */ + class ListDataItemsResponse implements IListDataItemsResponse { + + /** + * Constructs a new ListDataItemsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListDataItemsResponse); + + /** ListDataItemsResponse dataItems. */ + public dataItems: google.cloud.datalabeling.v1beta1.IDataItem[]; + + /** ListDataItemsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDataItemsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataItemsResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListDataItemsResponse): google.cloud.datalabeling.v1beta1.ListDataItemsResponse; + + /** + * Encodes the specified ListDataItemsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDataItemsResponse.verify|verify} messages. + * @param message ListDataItemsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListDataItemsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataItemsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDataItemsResponse.verify|verify} messages. + * @param message ListDataItemsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListDataItemsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataItemsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataItemsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListDataItemsResponse; + + /** + * Decodes a ListDataItemsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataItemsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListDataItemsResponse; + + /** + * Verifies a ListDataItemsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataItemsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataItemsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListDataItemsResponse; + + /** + * Creates a plain object from a ListDataItemsResponse message. Also converts values to other types if specified. + * @param message ListDataItemsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListDataItemsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataItemsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataItemsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAnnotatedDatasetRequest. */ + interface IGetAnnotatedDatasetRequest { + + /** GetAnnotatedDatasetRequest name */ + name?: (string|null); + } + + /** Represents a GetAnnotatedDatasetRequest. */ + class GetAnnotatedDatasetRequest implements IGetAnnotatedDatasetRequest { + + /** + * Constructs a new GetAnnotatedDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest); + + /** GetAnnotatedDatasetRequest name. */ + public name: string; + + /** + * Creates a new GetAnnotatedDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnnotatedDatasetRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest): google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest; + + /** + * Encodes the specified GetAnnotatedDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest.verify|verify} messages. + * @param message GetAnnotatedDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnnotatedDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest.verify|verify} messages. + * @param message GetAnnotatedDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnnotatedDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnnotatedDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest; + + /** + * Decodes a GetAnnotatedDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnnotatedDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest; + + /** + * Verifies a GetAnnotatedDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnnotatedDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnnotatedDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest; + + /** + * Creates a plain object from a GetAnnotatedDatasetRequest message. Also converts values to other types if specified. + * @param message GetAnnotatedDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnnotatedDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnnotatedDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnnotatedDatasetsRequest. */ + interface IListAnnotatedDatasetsRequest { + + /** ListAnnotatedDatasetsRequest parent */ + parent?: (string|null); + + /** ListAnnotatedDatasetsRequest filter */ + filter?: (string|null); + + /** ListAnnotatedDatasetsRequest pageSize */ + pageSize?: (number|null); + + /** ListAnnotatedDatasetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAnnotatedDatasetsRequest. */ + class ListAnnotatedDatasetsRequest implements IListAnnotatedDatasetsRequest { + + /** + * Constructs a new ListAnnotatedDatasetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest); + + /** ListAnnotatedDatasetsRequest parent. */ + public parent: string; + + /** ListAnnotatedDatasetsRequest filter. */ + public filter: string; + + /** ListAnnotatedDatasetsRequest pageSize. */ + public pageSize: number; + + /** ListAnnotatedDatasetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAnnotatedDatasetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnnotatedDatasetsRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest): google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest; + + /** + * Encodes the specified ListAnnotatedDatasetsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.verify|verify} messages. + * @param message ListAnnotatedDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnnotatedDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.verify|verify} messages. + * @param message ListAnnotatedDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnnotatedDatasetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnnotatedDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest; + + /** + * Decodes a ListAnnotatedDatasetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnnotatedDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest; + + /** + * Verifies a ListAnnotatedDatasetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnnotatedDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnnotatedDatasetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest; + + /** + * Creates a plain object from a ListAnnotatedDatasetsRequest message. Also converts values to other types if specified. + * @param message ListAnnotatedDatasetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnnotatedDatasetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnnotatedDatasetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnnotatedDatasetsResponse. */ + interface IListAnnotatedDatasetsResponse { + + /** ListAnnotatedDatasetsResponse annotatedDatasets */ + annotatedDatasets?: (google.cloud.datalabeling.v1beta1.IAnnotatedDataset[]|null); + + /** ListAnnotatedDatasetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAnnotatedDatasetsResponse. */ + class ListAnnotatedDatasetsResponse implements IListAnnotatedDatasetsResponse { + + /** + * Constructs a new ListAnnotatedDatasetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse); + + /** ListAnnotatedDatasetsResponse annotatedDatasets. */ + public annotatedDatasets: google.cloud.datalabeling.v1beta1.IAnnotatedDataset[]; + + /** ListAnnotatedDatasetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAnnotatedDatasetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnnotatedDatasetsResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse): google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse; + + /** + * Encodes the specified ListAnnotatedDatasetsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.verify|verify} messages. + * @param message ListAnnotatedDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnnotatedDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.verify|verify} messages. + * @param message ListAnnotatedDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnnotatedDatasetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnnotatedDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse; + + /** + * Decodes a ListAnnotatedDatasetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnnotatedDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse; + + /** + * Verifies a ListAnnotatedDatasetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnnotatedDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnnotatedDatasetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse; + + /** + * Creates a plain object from a ListAnnotatedDatasetsResponse message. Also converts values to other types if specified. + * @param message ListAnnotatedDatasetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnnotatedDatasetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnnotatedDatasetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAnnotatedDatasetRequest. */ + interface IDeleteAnnotatedDatasetRequest { + + /** DeleteAnnotatedDatasetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAnnotatedDatasetRequest. */ + class DeleteAnnotatedDatasetRequest implements IDeleteAnnotatedDatasetRequest { + + /** + * Constructs a new DeleteAnnotatedDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest); + + /** DeleteAnnotatedDatasetRequest name. */ + public name: string; + + /** + * Creates a new DeleteAnnotatedDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAnnotatedDatasetRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest): google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest; + + /** + * Encodes the specified DeleteAnnotatedDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest.verify|verify} messages. + * @param message DeleteAnnotatedDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAnnotatedDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest.verify|verify} messages. + * @param message DeleteAnnotatedDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAnnotatedDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAnnotatedDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest; + + /** + * Decodes a DeleteAnnotatedDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAnnotatedDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest; + + /** + * Verifies a DeleteAnnotatedDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAnnotatedDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAnnotatedDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest; + + /** + * Creates a plain object from a DeleteAnnotatedDatasetRequest message. Also converts values to other types if specified. + * @param message DeleteAnnotatedDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAnnotatedDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAnnotatedDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelImageRequest. */ + interface ILabelImageRequest { + + /** LabelImageRequest imageClassificationConfig */ + imageClassificationConfig?: (google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null); + + /** LabelImageRequest boundingPolyConfig */ + boundingPolyConfig?: (google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null); + + /** LabelImageRequest polylineConfig */ + polylineConfig?: (google.cloud.datalabeling.v1beta1.IPolylineConfig|null); + + /** LabelImageRequest segmentationConfig */ + segmentationConfig?: (google.cloud.datalabeling.v1beta1.ISegmentationConfig|null); + + /** LabelImageRequest parent */ + parent?: (string|null); + + /** LabelImageRequest basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** LabelImageRequest feature */ + feature?: (google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature|keyof typeof google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature|null); + } + + /** Represents a LabelImageRequest. */ + class LabelImageRequest implements ILabelImageRequest { + + /** + * Constructs a new LabelImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelImageRequest); + + /** LabelImageRequest imageClassificationConfig. */ + public imageClassificationConfig?: (google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null); + + /** LabelImageRequest boundingPolyConfig. */ + public boundingPolyConfig?: (google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null); + + /** LabelImageRequest polylineConfig. */ + public polylineConfig?: (google.cloud.datalabeling.v1beta1.IPolylineConfig|null); + + /** LabelImageRequest segmentationConfig. */ + public segmentationConfig?: (google.cloud.datalabeling.v1beta1.ISegmentationConfig|null); + + /** LabelImageRequest parent. */ + public parent: string; + + /** LabelImageRequest basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** LabelImageRequest feature. */ + public feature: (google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature|keyof typeof google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature); + + /** LabelImageRequest requestConfig. */ + public requestConfig?: ("imageClassificationConfig"|"boundingPolyConfig"|"polylineConfig"|"segmentationConfig"); + + /** + * Creates a new LabelImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelImageRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelImageRequest): google.cloud.datalabeling.v1beta1.LabelImageRequest; + + /** + * Encodes the specified LabelImageRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageRequest.verify|verify} messages. + * @param message LabelImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelImageRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageRequest.verify|verify} messages. + * @param message LabelImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelImageRequest; + + /** + * Decodes a LabelImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelImageRequest; + + /** + * Verifies a LabelImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelImageRequest; + + /** + * Creates a plain object from a LabelImageRequest message. Also converts values to other types if specified. + * @param message LabelImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelImageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LabelImageRequest { + + /** Feature enum. */ + enum Feature { + FEATURE_UNSPECIFIED = 0, + CLASSIFICATION = 1, + BOUNDING_BOX = 2, + ORIENTED_BOUNDING_BOX = 6, + BOUNDING_POLY = 3, + POLYLINE = 4, + SEGMENTATION = 5 + } + } + + /** Properties of a LabelVideoRequest. */ + interface ILabelVideoRequest { + + /** LabelVideoRequest videoClassificationConfig */ + videoClassificationConfig?: (google.cloud.datalabeling.v1beta1.IVideoClassificationConfig|null); + + /** LabelVideoRequest objectDetectionConfig */ + objectDetectionConfig?: (google.cloud.datalabeling.v1beta1.IObjectDetectionConfig|null); + + /** LabelVideoRequest objectTrackingConfig */ + objectTrackingConfig?: (google.cloud.datalabeling.v1beta1.IObjectTrackingConfig|null); + + /** LabelVideoRequest eventConfig */ + eventConfig?: (google.cloud.datalabeling.v1beta1.IEventConfig|null); + + /** LabelVideoRequest parent */ + parent?: (string|null); + + /** LabelVideoRequest basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** LabelVideoRequest feature */ + feature?: (google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature|keyof typeof google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature|null); + } + + /** Represents a LabelVideoRequest. */ + class LabelVideoRequest implements ILabelVideoRequest { + + /** + * Constructs a new LabelVideoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoRequest); + + /** LabelVideoRequest videoClassificationConfig. */ + public videoClassificationConfig?: (google.cloud.datalabeling.v1beta1.IVideoClassificationConfig|null); + + /** LabelVideoRequest objectDetectionConfig. */ + public objectDetectionConfig?: (google.cloud.datalabeling.v1beta1.IObjectDetectionConfig|null); + + /** LabelVideoRequest objectTrackingConfig. */ + public objectTrackingConfig?: (google.cloud.datalabeling.v1beta1.IObjectTrackingConfig|null); + + /** LabelVideoRequest eventConfig. */ + public eventConfig?: (google.cloud.datalabeling.v1beta1.IEventConfig|null); + + /** LabelVideoRequest parent. */ + public parent: string; + + /** LabelVideoRequest basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** LabelVideoRequest feature. */ + public feature: (google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature|keyof typeof google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature); + + /** LabelVideoRequest requestConfig. */ + public requestConfig?: ("videoClassificationConfig"|"objectDetectionConfig"|"objectTrackingConfig"|"eventConfig"); + + /** + * Creates a new LabelVideoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelVideoRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoRequest): google.cloud.datalabeling.v1beta1.LabelVideoRequest; + + /** + * Encodes the specified LabelVideoRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoRequest.verify|verify} messages. + * @param message LabelVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelVideoRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoRequest.verify|verify} messages. + * @param message LabelVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelVideoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelVideoRequest; + + /** + * Decodes a LabelVideoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelVideoRequest; + + /** + * Verifies a LabelVideoRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelVideoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelVideoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelVideoRequest; + + /** + * Creates a plain object from a LabelVideoRequest message. Also converts values to other types if specified. + * @param message LabelVideoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelVideoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelVideoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelVideoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LabelVideoRequest { + + /** Feature enum. */ + enum Feature { + FEATURE_UNSPECIFIED = 0, + CLASSIFICATION = 1, + OBJECT_DETECTION = 2, + OBJECT_TRACKING = 3, + EVENT = 4 + } + } + + /** Properties of a LabelTextRequest. */ + interface ILabelTextRequest { + + /** LabelTextRequest textClassificationConfig */ + textClassificationConfig?: (google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null); + + /** LabelTextRequest textEntityExtractionConfig */ + textEntityExtractionConfig?: (google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig|null); + + /** LabelTextRequest parent */ + parent?: (string|null); + + /** LabelTextRequest basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** LabelTextRequest feature */ + feature?: (google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature|keyof typeof google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature|null); + } + + /** Represents a LabelTextRequest. */ + class LabelTextRequest implements ILabelTextRequest { + + /** + * Constructs a new LabelTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelTextRequest); + + /** LabelTextRequest textClassificationConfig. */ + public textClassificationConfig?: (google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null); + + /** LabelTextRequest textEntityExtractionConfig. */ + public textEntityExtractionConfig?: (google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig|null); + + /** LabelTextRequest parent. */ + public parent: string; + + /** LabelTextRequest basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** LabelTextRequest feature. */ + public feature: (google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature|keyof typeof google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature); + + /** LabelTextRequest requestConfig. */ + public requestConfig?: ("textClassificationConfig"|"textEntityExtractionConfig"); + + /** + * Creates a new LabelTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelTextRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelTextRequest): google.cloud.datalabeling.v1beta1.LabelTextRequest; + + /** + * Encodes the specified LabelTextRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextRequest.verify|verify} messages. + * @param message LabelTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelTextRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextRequest.verify|verify} messages. + * @param message LabelTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelTextRequest; + + /** + * Decodes a LabelTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelTextRequest; + + /** + * Verifies a LabelTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelTextRequest; + + /** + * Creates a plain object from a LabelTextRequest message. Also converts values to other types if specified. + * @param message LabelTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LabelTextRequest { + + /** Feature enum. */ + enum Feature { + FEATURE_UNSPECIFIED = 0, + TEXT_CLASSIFICATION = 1, + TEXT_ENTITY_EXTRACTION = 2 + } + } + + /** Properties of a GetExampleRequest. */ + interface IGetExampleRequest { + + /** GetExampleRequest name */ + name?: (string|null); + + /** GetExampleRequest filter */ + filter?: (string|null); + } + + /** Represents a GetExampleRequest. */ + class GetExampleRequest implements IGetExampleRequest { + + /** + * Constructs a new GetExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGetExampleRequest); + + /** GetExampleRequest name. */ + public name: string; + + /** GetExampleRequest filter. */ + public filter: string; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExampleRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGetExampleRequest): google.cloud.datalabeling.v1beta1.GetExampleRequest; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GetExampleRequest; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GetExampleRequest; + + /** + * Verifies a GetExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GetExampleRequest; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @param message GetExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GetExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExamplesRequest. */ + interface IListExamplesRequest { + + /** ListExamplesRequest parent */ + parent?: (string|null); + + /** ListExamplesRequest filter */ + filter?: (string|null); + + /** ListExamplesRequest pageSize */ + pageSize?: (number|null); + + /** ListExamplesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListExamplesRequest. */ + class ListExamplesRequest implements IListExamplesRequest { + + /** + * Constructs a new ListExamplesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListExamplesRequest); + + /** ListExamplesRequest parent. */ + public parent: string; + + /** ListExamplesRequest filter. */ + public filter: string; + + /** ListExamplesRequest pageSize. */ + public pageSize: number; + + /** ListExamplesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListExamplesRequest): google.cloud.datalabeling.v1beta1.ListExamplesRequest; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListExamplesRequest; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListExamplesRequest; + + /** + * Verifies a ListExamplesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListExamplesRequest; + + /** + * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. + * @param message ListExamplesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExamplesResponse. */ + interface IListExamplesResponse { + + /** ListExamplesResponse examples */ + examples?: (google.cloud.datalabeling.v1beta1.IExample[]|null); + + /** ListExamplesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExamplesResponse. */ + class ListExamplesResponse implements IListExamplesResponse { + + /** + * Constructs a new ListExamplesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListExamplesResponse); + + /** ListExamplesResponse examples. */ + public examples: google.cloud.datalabeling.v1beta1.IExample[]; + + /** ListExamplesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListExamplesResponse): google.cloud.datalabeling.v1beta1.ListExamplesResponse; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListExamplesResponse; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListExamplesResponse; + + /** + * Verifies a ListExamplesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListExamplesResponse; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @param message ListExamplesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListExamplesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAnnotationSpecSetRequest. */ + interface ICreateAnnotationSpecSetRequest { + + /** CreateAnnotationSpecSetRequest parent */ + parent?: (string|null); + + /** CreateAnnotationSpecSetRequest annotationSpecSet */ + annotationSpecSet?: (google.cloud.datalabeling.v1beta1.IAnnotationSpecSet|null); + } + + /** Represents a CreateAnnotationSpecSetRequest. */ + class CreateAnnotationSpecSetRequest implements ICreateAnnotationSpecSetRequest { + + /** + * Constructs a new CreateAnnotationSpecSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest); + + /** CreateAnnotationSpecSetRequest parent. */ + public parent: string; + + /** CreateAnnotationSpecSetRequest annotationSpecSet. */ + public annotationSpecSet?: (google.cloud.datalabeling.v1beta1.IAnnotationSpecSet|null); + + /** + * Creates a new CreateAnnotationSpecSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAnnotationSpecSetRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest): google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest; + + /** + * Encodes the specified CreateAnnotationSpecSetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest.verify|verify} messages. + * @param message CreateAnnotationSpecSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAnnotationSpecSetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest.verify|verify} messages. + * @param message CreateAnnotationSpecSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAnnotationSpecSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest; + + /** + * Decodes a CreateAnnotationSpecSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest; + + /** + * Verifies a CreateAnnotationSpecSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAnnotationSpecSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAnnotationSpecSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest; + + /** + * Creates a plain object from a CreateAnnotationSpecSetRequest message. Also converts values to other types if specified. + * @param message CreateAnnotationSpecSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAnnotationSpecSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAnnotationSpecSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAnnotationSpecSetRequest. */ + interface IGetAnnotationSpecSetRequest { + + /** GetAnnotationSpecSetRequest name */ + name?: (string|null); + } + + /** Represents a GetAnnotationSpecSetRequest. */ + class GetAnnotationSpecSetRequest implements IGetAnnotationSpecSetRequest { + + /** + * Constructs a new GetAnnotationSpecSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest); + + /** GetAnnotationSpecSetRequest name. */ + public name: string; + + /** + * Creates a new GetAnnotationSpecSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnnotationSpecSetRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest): google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest; + + /** + * Encodes the specified GetAnnotationSpecSetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest.verify|verify} messages. + * @param message GetAnnotationSpecSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnnotationSpecSetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest.verify|verify} messages. + * @param message GetAnnotationSpecSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnnotationSpecSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest; + + /** + * Decodes a GetAnnotationSpecSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest; + + /** + * Verifies a GetAnnotationSpecSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnnotationSpecSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnnotationSpecSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest; + + /** + * Creates a plain object from a GetAnnotationSpecSetRequest message. Also converts values to other types if specified. + * @param message GetAnnotationSpecSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnnotationSpecSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnnotationSpecSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnnotationSpecSetsRequest. */ + interface IListAnnotationSpecSetsRequest { + + /** ListAnnotationSpecSetsRequest parent */ + parent?: (string|null); + + /** ListAnnotationSpecSetsRequest filter */ + filter?: (string|null); + + /** ListAnnotationSpecSetsRequest pageSize */ + pageSize?: (number|null); + + /** ListAnnotationSpecSetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAnnotationSpecSetsRequest. */ + class ListAnnotationSpecSetsRequest implements IListAnnotationSpecSetsRequest { + + /** + * Constructs a new ListAnnotationSpecSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest); + + /** ListAnnotationSpecSetsRequest parent. */ + public parent: string; + + /** ListAnnotationSpecSetsRequest filter. */ + public filter: string; + + /** ListAnnotationSpecSetsRequest pageSize. */ + public pageSize: number; + + /** ListAnnotationSpecSetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAnnotationSpecSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnnotationSpecSetsRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest): google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest; + + /** + * Encodes the specified ListAnnotationSpecSetsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.verify|verify} messages. + * @param message ListAnnotationSpecSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnnotationSpecSetsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.verify|verify} messages. + * @param message ListAnnotationSpecSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnnotationSpecSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnnotationSpecSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest; + + /** + * Decodes a ListAnnotationSpecSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnnotationSpecSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest; + + /** + * Verifies a ListAnnotationSpecSetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnnotationSpecSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnnotationSpecSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest; + + /** + * Creates a plain object from a ListAnnotationSpecSetsRequest message. Also converts values to other types if specified. + * @param message ListAnnotationSpecSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnnotationSpecSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnnotationSpecSetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnnotationSpecSetsResponse. */ + interface IListAnnotationSpecSetsResponse { + + /** ListAnnotationSpecSetsResponse annotationSpecSets */ + annotationSpecSets?: (google.cloud.datalabeling.v1beta1.IAnnotationSpecSet[]|null); + + /** ListAnnotationSpecSetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAnnotationSpecSetsResponse. */ + class ListAnnotationSpecSetsResponse implements IListAnnotationSpecSetsResponse { + + /** + * Constructs a new ListAnnotationSpecSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse); + + /** ListAnnotationSpecSetsResponse annotationSpecSets. */ + public annotationSpecSets: google.cloud.datalabeling.v1beta1.IAnnotationSpecSet[]; + + /** ListAnnotationSpecSetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAnnotationSpecSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnnotationSpecSetsResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse): google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse; + + /** + * Encodes the specified ListAnnotationSpecSetsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.verify|verify} messages. + * @param message ListAnnotationSpecSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnnotationSpecSetsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.verify|verify} messages. + * @param message ListAnnotationSpecSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnnotationSpecSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnnotationSpecSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse; + + /** + * Decodes a ListAnnotationSpecSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnnotationSpecSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse; + + /** + * Verifies a ListAnnotationSpecSetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnnotationSpecSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnnotationSpecSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse; + + /** + * Creates a plain object from a ListAnnotationSpecSetsResponse message. Also converts values to other types if specified. + * @param message ListAnnotationSpecSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnnotationSpecSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnnotationSpecSetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAnnotationSpecSetRequest. */ + interface IDeleteAnnotationSpecSetRequest { + + /** DeleteAnnotationSpecSetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAnnotationSpecSetRequest. */ + class DeleteAnnotationSpecSetRequest implements IDeleteAnnotationSpecSetRequest { + + /** + * Constructs a new DeleteAnnotationSpecSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest); + + /** DeleteAnnotationSpecSetRequest name. */ + public name: string; + + /** + * Creates a new DeleteAnnotationSpecSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAnnotationSpecSetRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest): google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest; + + /** + * Encodes the specified DeleteAnnotationSpecSetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest.verify|verify} messages. + * @param message DeleteAnnotationSpecSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAnnotationSpecSetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest.verify|verify} messages. + * @param message DeleteAnnotationSpecSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAnnotationSpecSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest; + + /** + * Decodes a DeleteAnnotationSpecSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest; + + /** + * Verifies a DeleteAnnotationSpecSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAnnotationSpecSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAnnotationSpecSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest; + + /** + * Creates a plain object from a DeleteAnnotationSpecSetRequest message. Also converts values to other types if specified. + * @param message DeleteAnnotationSpecSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAnnotationSpecSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAnnotationSpecSetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstructionRequest. */ + interface ICreateInstructionRequest { + + /** CreateInstructionRequest parent */ + parent?: (string|null); + + /** CreateInstructionRequest instruction */ + instruction?: (google.cloud.datalabeling.v1beta1.IInstruction|null); + } + + /** Represents a CreateInstructionRequest. */ + class CreateInstructionRequest implements ICreateInstructionRequest { + + /** + * Constructs a new CreateInstructionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ICreateInstructionRequest); + + /** CreateInstructionRequest parent. */ + public parent: string; + + /** CreateInstructionRequest instruction. */ + public instruction?: (google.cloud.datalabeling.v1beta1.IInstruction|null); + + /** + * Creates a new CreateInstructionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstructionRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ICreateInstructionRequest): google.cloud.datalabeling.v1beta1.CreateInstructionRequest; + + /** + * Encodes the specified CreateInstructionRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateInstructionRequest.verify|verify} messages. + * @param message CreateInstructionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ICreateInstructionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstructionRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateInstructionRequest.verify|verify} messages. + * @param message CreateInstructionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ICreateInstructionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstructionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.CreateInstructionRequest; + + /** + * Decodes a CreateInstructionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.CreateInstructionRequest; + + /** + * Verifies a CreateInstructionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstructionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstructionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.CreateInstructionRequest; + + /** + * Creates a plain object from a CreateInstructionRequest message. Also converts values to other types if specified. + * @param message CreateInstructionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.CreateInstructionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstructionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstructionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstructionRequest. */ + interface IGetInstructionRequest { + + /** GetInstructionRequest name */ + name?: (string|null); + } + + /** Represents a GetInstructionRequest. */ + class GetInstructionRequest implements IGetInstructionRequest { + + /** + * Constructs a new GetInstructionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGetInstructionRequest); + + /** GetInstructionRequest name. */ + public name: string; + + /** + * Creates a new GetInstructionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstructionRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGetInstructionRequest): google.cloud.datalabeling.v1beta1.GetInstructionRequest; + + /** + * Encodes the specified GetInstructionRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetInstructionRequest.verify|verify} messages. + * @param message GetInstructionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGetInstructionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstructionRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetInstructionRequest.verify|verify} messages. + * @param message GetInstructionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGetInstructionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstructionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GetInstructionRequest; + + /** + * Decodes a GetInstructionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GetInstructionRequest; + + /** + * Verifies a GetInstructionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstructionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstructionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GetInstructionRequest; + + /** + * Creates a plain object from a GetInstructionRequest message. Also converts values to other types if specified. + * @param message GetInstructionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GetInstructionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstructionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstructionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstructionRequest. */ + interface IDeleteInstructionRequest { + + /** DeleteInstructionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstructionRequest. */ + class DeleteInstructionRequest implements IDeleteInstructionRequest { + + /** + * Constructs a new DeleteInstructionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest); + + /** DeleteInstructionRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstructionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstructionRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest): google.cloud.datalabeling.v1beta1.DeleteInstructionRequest; + + /** + * Encodes the specified DeleteInstructionRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteInstructionRequest.verify|verify} messages. + * @param message DeleteInstructionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstructionRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteInstructionRequest.verify|verify} messages. + * @param message DeleteInstructionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstructionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.DeleteInstructionRequest; + + /** + * Decodes a DeleteInstructionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.DeleteInstructionRequest; + + /** + * Verifies a DeleteInstructionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstructionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstructionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.DeleteInstructionRequest; + + /** + * Creates a plain object from a DeleteInstructionRequest message. Also converts values to other types if specified. + * @param message DeleteInstructionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.DeleteInstructionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstructionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstructionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstructionsRequest. */ + interface IListInstructionsRequest { + + /** ListInstructionsRequest parent */ + parent?: (string|null); + + /** ListInstructionsRequest filter */ + filter?: (string|null); + + /** ListInstructionsRequest pageSize */ + pageSize?: (number|null); + + /** ListInstructionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListInstructionsRequest. */ + class ListInstructionsRequest implements IListInstructionsRequest { + + /** + * Constructs a new ListInstructionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListInstructionsRequest); + + /** ListInstructionsRequest parent. */ + public parent: string; + + /** ListInstructionsRequest filter. */ + public filter: string; + + /** ListInstructionsRequest pageSize. */ + public pageSize: number; + + /** ListInstructionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListInstructionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstructionsRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListInstructionsRequest): google.cloud.datalabeling.v1beta1.ListInstructionsRequest; + + /** + * Encodes the specified ListInstructionsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListInstructionsRequest.verify|verify} messages. + * @param message ListInstructionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListInstructionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstructionsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListInstructionsRequest.verify|verify} messages. + * @param message ListInstructionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListInstructionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstructionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstructionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListInstructionsRequest; + + /** + * Decodes a ListInstructionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstructionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListInstructionsRequest; + + /** + * Verifies a ListInstructionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstructionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstructionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListInstructionsRequest; + + /** + * Creates a plain object from a ListInstructionsRequest message. Also converts values to other types if specified. + * @param message ListInstructionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListInstructionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstructionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstructionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstructionsResponse. */ + interface IListInstructionsResponse { + + /** ListInstructionsResponse instructions */ + instructions?: (google.cloud.datalabeling.v1beta1.IInstruction[]|null); + + /** ListInstructionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstructionsResponse. */ + class ListInstructionsResponse implements IListInstructionsResponse { + + /** + * Constructs a new ListInstructionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListInstructionsResponse); + + /** ListInstructionsResponse instructions. */ + public instructions: google.cloud.datalabeling.v1beta1.IInstruction[]; + + /** ListInstructionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstructionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstructionsResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListInstructionsResponse): google.cloud.datalabeling.v1beta1.ListInstructionsResponse; + + /** + * Encodes the specified ListInstructionsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListInstructionsResponse.verify|verify} messages. + * @param message ListInstructionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListInstructionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstructionsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListInstructionsResponse.verify|verify} messages. + * @param message ListInstructionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListInstructionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstructionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstructionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListInstructionsResponse; + + /** + * Decodes a ListInstructionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstructionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListInstructionsResponse; + + /** + * Verifies a ListInstructionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstructionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstructionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListInstructionsResponse; + + /** + * Creates a plain object from a ListInstructionsResponse message. Also converts values to other types if specified. + * @param message ListInstructionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListInstructionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstructionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstructionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationRequest. */ + interface IGetEvaluationRequest { + + /** GetEvaluationRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationRequest. */ + class GetEvaluationRequest implements IGetEvaluationRequest { + + /** + * Constructs a new GetEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGetEvaluationRequest); + + /** GetEvaluationRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGetEvaluationRequest): google.cloud.datalabeling.v1beta1.GetEvaluationRequest; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GetEvaluationRequest; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GetEvaluationRequest; + + /** + * Verifies a GetEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GetEvaluationRequest; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @param message GetEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GetEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchEvaluationsRequest. */ + interface ISearchEvaluationsRequest { + + /** SearchEvaluationsRequest parent */ + parent?: (string|null); + + /** SearchEvaluationsRequest filter */ + filter?: (string|null); + + /** SearchEvaluationsRequest pageSize */ + pageSize?: (number|null); + + /** SearchEvaluationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchEvaluationsRequest. */ + class SearchEvaluationsRequest implements ISearchEvaluationsRequest { + + /** + * Constructs a new SearchEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest); + + /** SearchEvaluationsRequest parent. */ + public parent: string; + + /** SearchEvaluationsRequest filter. */ + public filter: string; + + /** SearchEvaluationsRequest pageSize. */ + public pageSize: number; + + /** SearchEvaluationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchEvaluationsRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest): google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest; + + /** + * Encodes the specified SearchEvaluationsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest.verify|verify} messages. + * @param message SearchEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest.verify|verify} messages. + * @param message SearchEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest; + + /** + * Decodes a SearchEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest; + + /** + * Verifies a SearchEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest; + + /** + * Creates a plain object from a SearchEvaluationsRequest message. Also converts values to other types if specified. + * @param message SearchEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchEvaluationsResponse. */ + interface ISearchEvaluationsResponse { + + /** SearchEvaluationsResponse evaluations */ + evaluations?: (google.cloud.datalabeling.v1beta1.IEvaluation[]|null); + + /** SearchEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchEvaluationsResponse. */ + class SearchEvaluationsResponse implements ISearchEvaluationsResponse { + + /** + * Constructs a new SearchEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse); + + /** SearchEvaluationsResponse evaluations. */ + public evaluations: google.cloud.datalabeling.v1beta1.IEvaluation[]; + + /** SearchEvaluationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchEvaluationsResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse): google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse; + + /** + * Encodes the specified SearchEvaluationsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.verify|verify} messages. + * @param message SearchEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.verify|verify} messages. + * @param message SearchEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse; + + /** + * Decodes a SearchEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse; + + /** + * Verifies a SearchEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse; + + /** + * Creates a plain object from a SearchEvaluationsResponse message. Also converts values to other types if specified. + * @param message SearchEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchExampleComparisonsRequest. */ + interface ISearchExampleComparisonsRequest { + + /** SearchExampleComparisonsRequest parent */ + parent?: (string|null); + + /** SearchExampleComparisonsRequest pageSize */ + pageSize?: (number|null); + + /** SearchExampleComparisonsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchExampleComparisonsRequest. */ + class SearchExampleComparisonsRequest implements ISearchExampleComparisonsRequest { + + /** + * Constructs a new SearchExampleComparisonsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest); + + /** SearchExampleComparisonsRequest parent. */ + public parent: string; + + /** SearchExampleComparisonsRequest pageSize. */ + public pageSize: number; + + /** SearchExampleComparisonsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchExampleComparisonsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchExampleComparisonsRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest; + + /** + * Encodes the specified SearchExampleComparisonsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest.verify|verify} messages. + * @param message SearchExampleComparisonsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchExampleComparisonsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest.verify|verify} messages. + * @param message SearchExampleComparisonsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchExampleComparisonsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchExampleComparisonsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest; + + /** + * Decodes a SearchExampleComparisonsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchExampleComparisonsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest; + + /** + * Verifies a SearchExampleComparisonsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchExampleComparisonsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchExampleComparisonsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest; + + /** + * Creates a plain object from a SearchExampleComparisonsRequest message. Also converts values to other types if specified. + * @param message SearchExampleComparisonsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchExampleComparisonsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchExampleComparisonsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchExampleComparisonsResponse. */ + interface ISearchExampleComparisonsResponse { + + /** SearchExampleComparisonsResponse exampleComparisons */ + exampleComparisons?: (google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison[]|null); + + /** SearchExampleComparisonsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchExampleComparisonsResponse. */ + class SearchExampleComparisonsResponse implements ISearchExampleComparisonsResponse { + + /** + * Constructs a new SearchExampleComparisonsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse); + + /** SearchExampleComparisonsResponse exampleComparisons. */ + public exampleComparisons: google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison[]; + + /** SearchExampleComparisonsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchExampleComparisonsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchExampleComparisonsResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse; + + /** + * Encodes the specified SearchExampleComparisonsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.verify|verify} messages. + * @param message SearchExampleComparisonsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchExampleComparisonsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.verify|verify} messages. + * @param message SearchExampleComparisonsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchExampleComparisonsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchExampleComparisonsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse; + + /** + * Decodes a SearchExampleComparisonsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchExampleComparisonsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse; + + /** + * Verifies a SearchExampleComparisonsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchExampleComparisonsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchExampleComparisonsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse; + + /** + * Creates a plain object from a SearchExampleComparisonsResponse message. Also converts values to other types if specified. + * @param message SearchExampleComparisonsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchExampleComparisonsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchExampleComparisonsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchExampleComparisonsResponse { + + /** Properties of an ExampleComparison. */ + interface IExampleComparison { + + /** ExampleComparison groundTruthExample */ + groundTruthExample?: (google.cloud.datalabeling.v1beta1.IExample|null); + + /** ExampleComparison modelCreatedExamples */ + modelCreatedExamples?: (google.cloud.datalabeling.v1beta1.IExample[]|null); + } + + /** Represents an ExampleComparison. */ + class ExampleComparison implements IExampleComparison { + + /** + * Constructs a new ExampleComparison. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison); + + /** ExampleComparison groundTruthExample. */ + public groundTruthExample?: (google.cloud.datalabeling.v1beta1.IExample|null); + + /** ExampleComparison modelCreatedExamples. */ + public modelCreatedExamples: google.cloud.datalabeling.v1beta1.IExample[]; + + /** + * Creates a new ExampleComparison instance using the specified properties. + * @param [properties] Properties to set + * @returns ExampleComparison instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison; + + /** + * Encodes the specified ExampleComparison message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.verify|verify} messages. + * @param message ExampleComparison message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExampleComparison message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.verify|verify} messages. + * @param message ExampleComparison message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExampleComparison message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExampleComparison + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison; + + /** + * Decodes an ExampleComparison message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExampleComparison + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison; + + /** + * Verifies an ExampleComparison message. + * @param message Plain 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 ExampleComparison message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExampleComparison + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison; + + /** + * Creates a plain object from an ExampleComparison message. Also converts values to other types if specified. + * @param message ExampleComparison + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExampleComparison to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExampleComparison + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateEvaluationJobRequest. */ + interface ICreateEvaluationJobRequest { + + /** CreateEvaluationJobRequest parent */ + parent?: (string|null); + + /** CreateEvaluationJobRequest job */ + job?: (google.cloud.datalabeling.v1beta1.IEvaluationJob|null); + } + + /** Represents a CreateEvaluationJobRequest. */ + class CreateEvaluationJobRequest implements ICreateEvaluationJobRequest { + + /** + * Constructs a new CreateEvaluationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest); + + /** CreateEvaluationJobRequest parent. */ + public parent: string; + + /** CreateEvaluationJobRequest job. */ + public job?: (google.cloud.datalabeling.v1beta1.IEvaluationJob|null); + + /** + * Creates a new CreateEvaluationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEvaluationJobRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest): google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest; + + /** + * Encodes the specified CreateEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest.verify|verify} messages. + * @param message CreateEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest.verify|verify} messages. + * @param message CreateEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEvaluationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest; + + /** + * Decodes a CreateEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest; + + /** + * Verifies a CreateEvaluationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEvaluationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest; + + /** + * Creates a plain object from a CreateEvaluationJobRequest message. Also converts values to other types if specified. + * @param message CreateEvaluationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEvaluationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEvaluationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEvaluationJobRequest. */ + interface IUpdateEvaluationJobRequest { + + /** UpdateEvaluationJobRequest evaluationJob */ + evaluationJob?: (google.cloud.datalabeling.v1beta1.IEvaluationJob|null); + + /** UpdateEvaluationJobRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEvaluationJobRequest. */ + class UpdateEvaluationJobRequest implements IUpdateEvaluationJobRequest { + + /** + * Constructs a new UpdateEvaluationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest); + + /** UpdateEvaluationJobRequest evaluationJob. */ + public evaluationJob?: (google.cloud.datalabeling.v1beta1.IEvaluationJob|null); + + /** UpdateEvaluationJobRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEvaluationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEvaluationJobRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest): google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest; + + /** + * Encodes the specified UpdateEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest.verify|verify} messages. + * @param message UpdateEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest.verify|verify} messages. + * @param message UpdateEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEvaluationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest; + + /** + * Decodes an UpdateEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest; + + /** + * Verifies an UpdateEvaluationJobRequest message. + * @param message Plain 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 UpdateEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEvaluationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest; + + /** + * Creates a plain object from an UpdateEvaluationJobRequest message. Also converts values to other types if specified. + * @param message UpdateEvaluationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEvaluationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEvaluationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationJobRequest. */ + interface IGetEvaluationJobRequest { + + /** GetEvaluationJobRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationJobRequest. */ + class GetEvaluationJobRequest implements IGetEvaluationJobRequest { + + /** + * Constructs a new GetEvaluationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest); + + /** GetEvaluationJobRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationJobRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest): google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest; + + /** + * Encodes the specified GetEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest.verify|verify} messages. + * @param message GetEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest.verify|verify} messages. + * @param message GetEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest; + + /** + * Decodes a GetEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest; + + /** + * Verifies a GetEvaluationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest; + + /** + * Creates a plain object from a GetEvaluationJobRequest message. Also converts values to other types if specified. + * @param message GetEvaluationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PauseEvaluationJobRequest. */ + interface IPauseEvaluationJobRequest { + + /** PauseEvaluationJobRequest name */ + name?: (string|null); + } + + /** Represents a PauseEvaluationJobRequest. */ + class PauseEvaluationJobRequest implements IPauseEvaluationJobRequest { + + /** + * Constructs a new PauseEvaluationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest); + + /** PauseEvaluationJobRequest name. */ + public name: string; + + /** + * Creates a new PauseEvaluationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PauseEvaluationJobRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest): google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest; + + /** + * Encodes the specified PauseEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest.verify|verify} messages. + * @param message PauseEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PauseEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest.verify|verify} messages. + * @param message PauseEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PauseEvaluationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PauseEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest; + + /** + * Decodes a PauseEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PauseEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest; + + /** + * Verifies a PauseEvaluationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PauseEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PauseEvaluationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest; + + /** + * Creates a plain object from a PauseEvaluationJobRequest message. Also converts values to other types if specified. + * @param message PauseEvaluationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PauseEvaluationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PauseEvaluationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResumeEvaluationJobRequest. */ + interface IResumeEvaluationJobRequest { + + /** ResumeEvaluationJobRequest name */ + name?: (string|null); + } + + /** Represents a ResumeEvaluationJobRequest. */ + class ResumeEvaluationJobRequest implements IResumeEvaluationJobRequest { + + /** + * Constructs a new ResumeEvaluationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest); + + /** ResumeEvaluationJobRequest name. */ + public name: string; + + /** + * Creates a new ResumeEvaluationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResumeEvaluationJobRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest): google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest; + + /** + * Encodes the specified ResumeEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest.verify|verify} messages. + * @param message ResumeEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResumeEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest.verify|verify} messages. + * @param message ResumeEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResumeEvaluationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResumeEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest; + + /** + * Decodes a ResumeEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResumeEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest; + + /** + * Verifies a ResumeEvaluationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResumeEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResumeEvaluationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest; + + /** + * Creates a plain object from a ResumeEvaluationJobRequest message. Also converts values to other types if specified. + * @param message ResumeEvaluationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResumeEvaluationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResumeEvaluationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationJobRequest. */ + interface IDeleteEvaluationJobRequest { + + /** DeleteEvaluationJobRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEvaluationJobRequest. */ + class DeleteEvaluationJobRequest implements IDeleteEvaluationJobRequest { + + /** + * Constructs a new DeleteEvaluationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest); + + /** DeleteEvaluationJobRequest name. */ + public name: string; + + /** + * Creates a new DeleteEvaluationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationJobRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest): google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest; + + /** + * Encodes the specified DeleteEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest.verify|verify} messages. + * @param message DeleteEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest.verify|verify} messages. + * @param message DeleteEvaluationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest; + + /** + * Decodes a DeleteEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest; + + /** + * Verifies a DeleteEvaluationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest; + + /** + * Creates a plain object from a DeleteEvaluationJobRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationJobsRequest. */ + interface IListEvaluationJobsRequest { + + /** ListEvaluationJobsRequest parent */ + parent?: (string|null); + + /** ListEvaluationJobsRequest filter */ + filter?: (string|null); + + /** ListEvaluationJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationJobsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEvaluationJobsRequest. */ + class ListEvaluationJobsRequest implements IListEvaluationJobsRequest { + + /** + * Constructs a new ListEvaluationJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest); + + /** ListEvaluationJobsRequest parent. */ + public parent: string; + + /** ListEvaluationJobsRequest filter. */ + public filter: string; + + /** ListEvaluationJobsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationJobsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEvaluationJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationJobsRequest instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest): google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest; + + /** + * Encodes the specified ListEvaluationJobsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest.verify|verify} messages. + * @param message ListEvaluationJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationJobsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest.verify|verify} messages. + * @param message ListEvaluationJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest; + + /** + * Decodes a ListEvaluationJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest; + + /** + * Verifies a ListEvaluationJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest; + + /** + * Creates a plain object from a ListEvaluationJobsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationJobsResponse. */ + interface IListEvaluationJobsResponse { + + /** ListEvaluationJobsResponse evaluationJobs */ + evaluationJobs?: (google.cloud.datalabeling.v1beta1.IEvaluationJob[]|null); + + /** ListEvaluationJobsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationJobsResponse. */ + class ListEvaluationJobsResponse implements IListEvaluationJobsResponse { + + /** + * Constructs a new ListEvaluationJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse); + + /** ListEvaluationJobsResponse evaluationJobs. */ + public evaluationJobs: google.cloud.datalabeling.v1beta1.IEvaluationJob[]; + + /** ListEvaluationJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationJobsResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse): google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse; + + /** + * Encodes the specified ListEvaluationJobsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.verify|verify} messages. + * @param message ListEvaluationJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationJobsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.verify|verify} messages. + * @param message ListEvaluationJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse; + + /** + * Decodes a ListEvaluationJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse; + + /** + * Verifies a ListEvaluationJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse; + + /** + * Creates a plain object from a ListEvaluationJobsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + IMAGE = 1, + VIDEO = 2, + TEXT = 4, + GENERAL_DATA = 6 + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset name */ + name?: (string|null); + + /** Dataset displayName */ + displayName?: (string|null); + + /** Dataset description */ + description?: (string|null); + + /** Dataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset inputConfigs */ + inputConfigs?: (google.cloud.datalabeling.v1beta1.IInputConfig[]|null); + + /** Dataset blockingResources */ + blockingResources?: (string[]|null); + + /** Dataset dataItemCount */ + dataItemCount?: (number|Long|string|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IDataset); + + /** Dataset name. */ + public name: string; + + /** Dataset displayName. */ + public displayName: string; + + /** Dataset description. */ + public description: string; + + /** Dataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset inputConfigs. */ + public inputConfigs: google.cloud.datalabeling.v1beta1.IInputConfig[]; + + /** Dataset blockingResources. */ + public blockingResources: string[]; + + /** Dataset dataItemCount. */ + public dataItemCount: (number|Long|string); + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IDataset): google.cloud.datalabeling.v1beta1.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig textMetadata */ + textMetadata?: (google.cloud.datalabeling.v1beta1.ITextMetadata|null); + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.datalabeling.v1beta1.IGcsSource|null); + + /** InputConfig bigquerySource */ + bigquerySource?: (google.cloud.datalabeling.v1beta1.IBigQuerySource|null); + + /** InputConfig dataType */ + dataType?: (google.cloud.datalabeling.v1beta1.DataType|keyof typeof google.cloud.datalabeling.v1beta1.DataType|null); + + /** InputConfig annotationType */ + annotationType?: (google.cloud.datalabeling.v1beta1.AnnotationType|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationType|null); + + /** InputConfig classificationMetadata */ + classificationMetadata?: (google.cloud.datalabeling.v1beta1.IClassificationMetadata|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IInputConfig); + + /** InputConfig textMetadata. */ + public textMetadata?: (google.cloud.datalabeling.v1beta1.ITextMetadata|null); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.datalabeling.v1beta1.IGcsSource|null); + + /** InputConfig bigquerySource. */ + public bigquerySource?: (google.cloud.datalabeling.v1beta1.IBigQuerySource|null); + + /** InputConfig dataType. */ + public dataType: (google.cloud.datalabeling.v1beta1.DataType|keyof typeof google.cloud.datalabeling.v1beta1.DataType); + + /** InputConfig annotationType. */ + public annotationType: (google.cloud.datalabeling.v1beta1.AnnotationType|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationType); + + /** InputConfig classificationMetadata. */ + public classificationMetadata?: (google.cloud.datalabeling.v1beta1.IClassificationMetadata|null); + + /** InputConfig dataTypeMetadata. */ + public dataTypeMetadata?: "textMetadata"; + + /** InputConfig source. */ + public source?: ("gcsSource"|"bigquerySource"); + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IInputConfig): google.cloud.datalabeling.v1beta1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.InputConfig; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.InputConfig; + + /** + * Verifies an InputConfig message. + * @param message Plain 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 InputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.InputConfig; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @param message InputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextMetadata. */ + interface ITextMetadata { + + /** TextMetadata languageCode */ + languageCode?: (string|null); + } + + /** Represents a TextMetadata. */ + class TextMetadata implements ITextMetadata { + + /** + * Constructs a new TextMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ITextMetadata); + + /** TextMetadata languageCode. */ + public languageCode: string; + + /** + * Creates a new TextMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ITextMetadata): google.cloud.datalabeling.v1beta1.TextMetadata; + + /** + * Encodes the specified TextMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextMetadata.verify|verify} messages. + * @param message TextMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ITextMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextMetadata.verify|verify} messages. + * @param message TextMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ITextMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.TextMetadata; + + /** + * Decodes a TextMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.TextMetadata; + + /** + * Verifies a TextMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.TextMetadata; + + /** + * Creates a plain object from a TextMetadata message. Also converts values to other types if specified. + * @param message TextMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.TextMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationMetadata. */ + interface IClassificationMetadata { + + /** ClassificationMetadata isMultiLabel */ + isMultiLabel?: (boolean|null); + } + + /** Represents a ClassificationMetadata. */ + class ClassificationMetadata implements IClassificationMetadata { + + /** + * Constructs a new ClassificationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IClassificationMetadata); + + /** ClassificationMetadata isMultiLabel. */ + public isMultiLabel: boolean; + + /** + * Creates a new ClassificationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IClassificationMetadata): google.cloud.datalabeling.v1beta1.ClassificationMetadata; + + /** + * Encodes the specified ClassificationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ClassificationMetadata.verify|verify} messages. + * @param message ClassificationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IClassificationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ClassificationMetadata.verify|verify} messages. + * @param message ClassificationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IClassificationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ClassificationMetadata; + + /** + * Decodes a ClassificationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ClassificationMetadata; + + /** + * Verifies a ClassificationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ClassificationMetadata; + + /** + * Creates a plain object from a ClassificationMetadata message. Also converts values to other types if specified. + * @param message ClassificationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ClassificationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource inputUri */ + inputUri?: (string|null); + + /** GcsSource mimeType */ + mimeType?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGcsSource); + + /** GcsSource inputUri. */ + public inputUri: string; + + /** GcsSource mimeType. */ + public mimeType: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGcsSource): google.cloud.datalabeling.v1beta1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQuerySource. */ + interface IBigQuerySource { + + /** BigQuerySource inputUri */ + inputUri?: (string|null); + } + + /** Represents a BigQuerySource. */ + class BigQuerySource implements IBigQuerySource { + + /** + * Constructs a new BigQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IBigQuerySource); + + /** BigQuerySource inputUri. */ + public inputUri: string; + + /** + * Creates a new BigQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQuerySource instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IBigQuerySource): google.cloud.datalabeling.v1beta1.BigQuerySource; + + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.BigQuerySource; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.BigQuerySource; + + /** + * Verifies a BigQuerySource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.BigQuerySource; + + /** + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * @param message BigQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.BigQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQuerySource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.datalabeling.v1beta1.IGcsDestination|null); + + /** OutputConfig gcsFolderDestination */ + gcsFolderDestination?: (google.cloud.datalabeling.v1beta1.IGcsFolderDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.datalabeling.v1beta1.IGcsDestination|null); + + /** OutputConfig gcsFolderDestination. */ + public gcsFolderDestination?: (google.cloud.datalabeling.v1beta1.IGcsFolderDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"gcsFolderDestination"); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IOutputConfig): google.cloud.datalabeling.v1beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination outputUri */ + outputUri?: (string|null); + + /** GcsDestination mimeType */ + mimeType?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGcsDestination); + + /** GcsDestination outputUri. */ + public outputUri: string; + + /** GcsDestination mimeType. */ + public mimeType: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGcsDestination): google.cloud.datalabeling.v1beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsFolderDestination. */ + interface IGcsFolderDestination { + + /** GcsFolderDestination outputFolderUri */ + outputFolderUri?: (string|null); + } + + /** Represents a GcsFolderDestination. */ + class GcsFolderDestination implements IGcsFolderDestination { + + /** + * Constructs a new GcsFolderDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IGcsFolderDestination); + + /** GcsFolderDestination outputFolderUri. */ + public outputFolderUri: string; + + /** + * Creates a new GcsFolderDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsFolderDestination instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IGcsFolderDestination): google.cloud.datalabeling.v1beta1.GcsFolderDestination; + + /** + * Encodes the specified GcsFolderDestination message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsFolderDestination.verify|verify} messages. + * @param message GcsFolderDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IGcsFolderDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsFolderDestination message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsFolderDestination.verify|verify} messages. + * @param message GcsFolderDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IGcsFolderDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsFolderDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsFolderDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.GcsFolderDestination; + + /** + * Decodes a GcsFolderDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsFolderDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.GcsFolderDestination; + + /** + * Verifies a GcsFolderDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsFolderDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsFolderDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.GcsFolderDestination; + + /** + * Creates a plain object from a GcsFolderDestination message. Also converts values to other types if specified. + * @param message GcsFolderDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.GcsFolderDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsFolderDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsFolderDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataItem. */ + interface IDataItem { + + /** DataItem imagePayload */ + imagePayload?: (google.cloud.datalabeling.v1beta1.IImagePayload|null); + + /** DataItem textPayload */ + textPayload?: (google.cloud.datalabeling.v1beta1.ITextPayload|null); + + /** DataItem videoPayload */ + videoPayload?: (google.cloud.datalabeling.v1beta1.IVideoPayload|null); + + /** DataItem name */ + name?: (string|null); + } + + /** Represents a DataItem. */ + class DataItem implements IDataItem { + + /** + * Constructs a new DataItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IDataItem); + + /** DataItem imagePayload. */ + public imagePayload?: (google.cloud.datalabeling.v1beta1.IImagePayload|null); + + /** DataItem textPayload. */ + public textPayload?: (google.cloud.datalabeling.v1beta1.ITextPayload|null); + + /** DataItem videoPayload. */ + public videoPayload?: (google.cloud.datalabeling.v1beta1.IVideoPayload|null); + + /** DataItem name. */ + public name: string; + + /** DataItem payload. */ + public payload?: ("imagePayload"|"textPayload"|"videoPayload"); + + /** + * Creates a new DataItem instance using the specified properties. + * @param [properties] Properties to set + * @returns DataItem instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IDataItem): google.cloud.datalabeling.v1beta1.DataItem; + + /** + * Encodes the specified DataItem message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DataItem.verify|verify} messages. + * @param message DataItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IDataItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataItem message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DataItem.verify|verify} messages. + * @param message DataItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IDataItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.DataItem; + + /** + * Decodes a DataItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.DataItem; + + /** + * Verifies a DataItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataItem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.DataItem; + + /** + * Creates a plain object from a DataItem message. Also converts values to other types if specified. + * @param message DataItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.DataItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotatedDataset. */ + interface IAnnotatedDataset { + + /** AnnotatedDataset name */ + name?: (string|null); + + /** AnnotatedDataset displayName */ + displayName?: (string|null); + + /** AnnotatedDataset description */ + description?: (string|null); + + /** AnnotatedDataset annotationSource */ + annotationSource?: (google.cloud.datalabeling.v1beta1.AnnotationSource|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationSource|null); + + /** AnnotatedDataset annotationType */ + annotationType?: (google.cloud.datalabeling.v1beta1.AnnotationType|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationType|null); + + /** AnnotatedDataset exampleCount */ + exampleCount?: (number|Long|string|null); + + /** AnnotatedDataset completedExampleCount */ + completedExampleCount?: (number|Long|string|null); + + /** AnnotatedDataset labelStats */ + labelStats?: (google.cloud.datalabeling.v1beta1.ILabelStats|null); + + /** AnnotatedDataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AnnotatedDataset metadata */ + metadata?: (google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata|null); + + /** AnnotatedDataset blockingResources */ + blockingResources?: (string[]|null); + } + + /** Represents an AnnotatedDataset. */ + class AnnotatedDataset implements IAnnotatedDataset { + + /** + * Constructs a new AnnotatedDataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IAnnotatedDataset); + + /** AnnotatedDataset name. */ + public name: string; + + /** AnnotatedDataset displayName. */ + public displayName: string; + + /** AnnotatedDataset description. */ + public description: string; + + /** AnnotatedDataset annotationSource. */ + public annotationSource: (google.cloud.datalabeling.v1beta1.AnnotationSource|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationSource); + + /** AnnotatedDataset annotationType. */ + public annotationType: (google.cloud.datalabeling.v1beta1.AnnotationType|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationType); + + /** AnnotatedDataset exampleCount. */ + public exampleCount: (number|Long|string); + + /** AnnotatedDataset completedExampleCount. */ + public completedExampleCount: (number|Long|string); + + /** AnnotatedDataset labelStats. */ + public labelStats?: (google.cloud.datalabeling.v1beta1.ILabelStats|null); + + /** AnnotatedDataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AnnotatedDataset metadata. */ + public metadata?: (google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata|null); + + /** AnnotatedDataset blockingResources. */ + public blockingResources: string[]; + + /** + * Creates a new AnnotatedDataset instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotatedDataset instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IAnnotatedDataset): google.cloud.datalabeling.v1beta1.AnnotatedDataset; + + /** + * Encodes the specified AnnotatedDataset message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotatedDataset.verify|verify} messages. + * @param message AnnotatedDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IAnnotatedDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotatedDataset message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotatedDataset.verify|verify} messages. + * @param message AnnotatedDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IAnnotatedDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotatedDataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotatedDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.AnnotatedDataset; + + /** + * Decodes an AnnotatedDataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotatedDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.AnnotatedDataset; + + /** + * Verifies an AnnotatedDataset message. + * @param message Plain 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 AnnotatedDataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotatedDataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.AnnotatedDataset; + + /** + * Creates a plain object from an AnnotatedDataset message. Also converts values to other types if specified. + * @param message AnnotatedDataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.AnnotatedDataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotatedDataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotatedDataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelStats. */ + interface ILabelStats { + + /** LabelStats exampleCount */ + exampleCount?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a LabelStats. */ + class LabelStats implements ILabelStats { + + /** + * Constructs a new LabelStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelStats); + + /** LabelStats exampleCount. */ + public exampleCount: { [k: string]: (number|Long|string) }; + + /** + * Creates a new LabelStats instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelStats instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelStats): google.cloud.datalabeling.v1beta1.LabelStats; + + /** + * Encodes the specified LabelStats message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelStats.verify|verify} messages. + * @param message LabelStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelStats message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelStats.verify|verify} messages. + * @param message LabelStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelStats; + + /** + * Decodes a LabelStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelStats; + + /** + * Verifies a LabelStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelStats; + + /** + * Creates a plain object from a LabelStats message. Also converts values to other types if specified. + * @param message LabelStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotatedDatasetMetadata. */ + interface IAnnotatedDatasetMetadata { + + /** AnnotatedDatasetMetadata imageClassificationConfig */ + imageClassificationConfig?: (google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null); + + /** AnnotatedDatasetMetadata boundingPolyConfig */ + boundingPolyConfig?: (google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null); + + /** AnnotatedDatasetMetadata polylineConfig */ + polylineConfig?: (google.cloud.datalabeling.v1beta1.IPolylineConfig|null); + + /** AnnotatedDatasetMetadata segmentationConfig */ + segmentationConfig?: (google.cloud.datalabeling.v1beta1.ISegmentationConfig|null); + + /** AnnotatedDatasetMetadata videoClassificationConfig */ + videoClassificationConfig?: (google.cloud.datalabeling.v1beta1.IVideoClassificationConfig|null); + + /** AnnotatedDatasetMetadata objectDetectionConfig */ + objectDetectionConfig?: (google.cloud.datalabeling.v1beta1.IObjectDetectionConfig|null); + + /** AnnotatedDatasetMetadata objectTrackingConfig */ + objectTrackingConfig?: (google.cloud.datalabeling.v1beta1.IObjectTrackingConfig|null); + + /** AnnotatedDatasetMetadata eventConfig */ + eventConfig?: (google.cloud.datalabeling.v1beta1.IEventConfig|null); + + /** AnnotatedDatasetMetadata textClassificationConfig */ + textClassificationConfig?: (google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null); + + /** AnnotatedDatasetMetadata textEntityExtractionConfig */ + textEntityExtractionConfig?: (google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig|null); + + /** AnnotatedDatasetMetadata humanAnnotationConfig */ + humanAnnotationConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents an AnnotatedDatasetMetadata. */ + class AnnotatedDatasetMetadata implements IAnnotatedDatasetMetadata { + + /** + * Constructs a new AnnotatedDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata); + + /** AnnotatedDatasetMetadata imageClassificationConfig. */ + public imageClassificationConfig?: (google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null); + + /** AnnotatedDatasetMetadata boundingPolyConfig. */ + public boundingPolyConfig?: (google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null); + + /** AnnotatedDatasetMetadata polylineConfig. */ + public polylineConfig?: (google.cloud.datalabeling.v1beta1.IPolylineConfig|null); + + /** AnnotatedDatasetMetadata segmentationConfig. */ + public segmentationConfig?: (google.cloud.datalabeling.v1beta1.ISegmentationConfig|null); + + /** AnnotatedDatasetMetadata videoClassificationConfig. */ + public videoClassificationConfig?: (google.cloud.datalabeling.v1beta1.IVideoClassificationConfig|null); + + /** AnnotatedDatasetMetadata objectDetectionConfig. */ + public objectDetectionConfig?: (google.cloud.datalabeling.v1beta1.IObjectDetectionConfig|null); + + /** AnnotatedDatasetMetadata objectTrackingConfig. */ + public objectTrackingConfig?: (google.cloud.datalabeling.v1beta1.IObjectTrackingConfig|null); + + /** AnnotatedDatasetMetadata eventConfig. */ + public eventConfig?: (google.cloud.datalabeling.v1beta1.IEventConfig|null); + + /** AnnotatedDatasetMetadata textClassificationConfig. */ + public textClassificationConfig?: (google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null); + + /** AnnotatedDatasetMetadata textEntityExtractionConfig. */ + public textEntityExtractionConfig?: (google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig|null); + + /** AnnotatedDatasetMetadata humanAnnotationConfig. */ + public humanAnnotationConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** AnnotatedDatasetMetadata annotationRequestConfig. */ + public annotationRequestConfig?: ("imageClassificationConfig"|"boundingPolyConfig"|"polylineConfig"|"segmentationConfig"|"videoClassificationConfig"|"objectDetectionConfig"|"objectTrackingConfig"|"eventConfig"|"textClassificationConfig"|"textEntityExtractionConfig"); + + /** + * Creates a new AnnotatedDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotatedDatasetMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata): google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata; + + /** + * Encodes the specified AnnotatedDatasetMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.verify|verify} messages. + * @param message AnnotatedDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotatedDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.verify|verify} messages. + * @param message AnnotatedDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotatedDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotatedDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata; + + /** + * Decodes an AnnotatedDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotatedDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata; + + /** + * Verifies an AnnotatedDatasetMetadata message. + * @param message Plain 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 AnnotatedDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotatedDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata; + + /** + * Creates a plain object from an AnnotatedDatasetMetadata message. Also converts values to other types if specified. + * @param message AnnotatedDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotatedDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotatedDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Example. */ + interface IExample { + + /** Example imagePayload */ + imagePayload?: (google.cloud.datalabeling.v1beta1.IImagePayload|null); + + /** Example textPayload */ + textPayload?: (google.cloud.datalabeling.v1beta1.ITextPayload|null); + + /** Example videoPayload */ + videoPayload?: (google.cloud.datalabeling.v1beta1.IVideoPayload|null); + + /** Example name */ + name?: (string|null); + + /** Example annotations */ + annotations?: (google.cloud.datalabeling.v1beta1.IAnnotation[]|null); + } + + /** Represents an Example. */ + class Example implements IExample { + + /** + * Constructs a new Example. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IExample); + + /** Example imagePayload. */ + public imagePayload?: (google.cloud.datalabeling.v1beta1.IImagePayload|null); + + /** Example textPayload. */ + public textPayload?: (google.cloud.datalabeling.v1beta1.ITextPayload|null); + + /** Example videoPayload. */ + public videoPayload?: (google.cloud.datalabeling.v1beta1.IVideoPayload|null); + + /** Example name. */ + public name: string; + + /** Example annotations. */ + public annotations: google.cloud.datalabeling.v1beta1.IAnnotation[]; + + /** Example payload. */ + public payload?: ("imagePayload"|"textPayload"|"videoPayload"); + + /** + * Creates a new Example instance using the specified properties. + * @param [properties] Properties to set + * @returns Example instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IExample): google.cloud.datalabeling.v1beta1.Example; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Example message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.Example; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.Example; + + /** + * Verifies an Example message. + * @param message Plain 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 Example message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Example + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.Example; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @param message Example + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Example to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Example + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImagePayload. */ + interface IImagePayload { + + /** ImagePayload mimeType */ + mimeType?: (string|null); + + /** ImagePayload imageThumbnail */ + imageThumbnail?: (Uint8Array|string|null); + + /** ImagePayload imageUri */ + imageUri?: (string|null); + + /** ImagePayload signedUri */ + signedUri?: (string|null); + } + + /** Represents an ImagePayload. */ + class ImagePayload implements IImagePayload { + + /** + * Constructs a new ImagePayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IImagePayload); + + /** ImagePayload mimeType. */ + public mimeType: string; + + /** ImagePayload imageThumbnail. */ + public imageThumbnail: (Uint8Array|string); + + /** ImagePayload imageUri. */ + public imageUri: string; + + /** ImagePayload signedUri. */ + public signedUri: string; + + /** + * Creates a new ImagePayload instance using the specified properties. + * @param [properties] Properties to set + * @returns ImagePayload instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IImagePayload): google.cloud.datalabeling.v1beta1.ImagePayload; + + /** + * Encodes the specified ImagePayload message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImagePayload.verify|verify} messages. + * @param message ImagePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IImagePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImagePayload message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImagePayload.verify|verify} messages. + * @param message ImagePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IImagePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImagePayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImagePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ImagePayload; + + /** + * Decodes an ImagePayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImagePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ImagePayload; + + /** + * Verifies an ImagePayload message. + * @param message Plain 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 ImagePayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImagePayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ImagePayload; + + /** + * Creates a plain object from an ImagePayload message. Also converts values to other types if specified. + * @param message ImagePayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ImagePayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImagePayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImagePayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextPayload. */ + interface ITextPayload { + + /** TextPayload textContent */ + textContent?: (string|null); + } + + /** Represents a TextPayload. */ + class TextPayload implements ITextPayload { + + /** + * Constructs a new TextPayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ITextPayload); + + /** TextPayload textContent. */ + public textContent: string; + + /** + * Creates a new TextPayload instance using the specified properties. + * @param [properties] Properties to set + * @returns TextPayload instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ITextPayload): google.cloud.datalabeling.v1beta1.TextPayload; + + /** + * Encodes the specified TextPayload message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextPayload.verify|verify} messages. + * @param message TextPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ITextPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextPayload message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextPayload.verify|verify} messages. + * @param message TextPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ITextPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextPayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.TextPayload; + + /** + * Decodes a TextPayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.TextPayload; + + /** + * Verifies a TextPayload message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextPayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextPayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.TextPayload; + + /** + * Creates a plain object from a TextPayload message. Also converts values to other types if specified. + * @param message TextPayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.TextPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextPayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextPayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoThumbnail. */ + interface IVideoThumbnail { + + /** VideoThumbnail thumbnail */ + thumbnail?: (Uint8Array|string|null); + + /** VideoThumbnail timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a VideoThumbnail. */ + class VideoThumbnail implements IVideoThumbnail { + + /** + * Constructs a new VideoThumbnail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IVideoThumbnail); + + /** VideoThumbnail thumbnail. */ + public thumbnail: (Uint8Array|string); + + /** VideoThumbnail timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new VideoThumbnail instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoThumbnail instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IVideoThumbnail): google.cloud.datalabeling.v1beta1.VideoThumbnail; + + /** + * Encodes the specified VideoThumbnail message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoThumbnail.verify|verify} messages. + * @param message VideoThumbnail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IVideoThumbnail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoThumbnail message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoThumbnail.verify|verify} messages. + * @param message VideoThumbnail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IVideoThumbnail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoThumbnail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoThumbnail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.VideoThumbnail; + + /** + * Decodes a VideoThumbnail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoThumbnail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.VideoThumbnail; + + /** + * Verifies a VideoThumbnail message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoThumbnail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoThumbnail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.VideoThumbnail; + + /** + * Creates a plain object from a VideoThumbnail message. Also converts values to other types if specified. + * @param message VideoThumbnail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.VideoThumbnail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoThumbnail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoThumbnail + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoPayload. */ + interface IVideoPayload { + + /** VideoPayload mimeType */ + mimeType?: (string|null); + + /** VideoPayload videoUri */ + videoUri?: (string|null); + + /** VideoPayload videoThumbnails */ + videoThumbnails?: (google.cloud.datalabeling.v1beta1.IVideoThumbnail[]|null); + + /** VideoPayload frameRate */ + frameRate?: (number|null); + + /** VideoPayload signedUri */ + signedUri?: (string|null); + } + + /** Represents a VideoPayload. */ + class VideoPayload implements IVideoPayload { + + /** + * Constructs a new VideoPayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IVideoPayload); + + /** VideoPayload mimeType. */ + public mimeType: string; + + /** VideoPayload videoUri. */ + public videoUri: string; + + /** VideoPayload videoThumbnails. */ + public videoThumbnails: google.cloud.datalabeling.v1beta1.IVideoThumbnail[]; + + /** VideoPayload frameRate. */ + public frameRate: number; + + /** VideoPayload signedUri. */ + public signedUri: string; + + /** + * Creates a new VideoPayload instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoPayload instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IVideoPayload): google.cloud.datalabeling.v1beta1.VideoPayload; + + /** + * Encodes the specified VideoPayload message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoPayload.verify|verify} messages. + * @param message VideoPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IVideoPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoPayload message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoPayload.verify|verify} messages. + * @param message VideoPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IVideoPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoPayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.VideoPayload; + + /** + * Decodes a VideoPayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.VideoPayload; + + /** + * Verifies a VideoPayload message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoPayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoPayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.VideoPayload; + + /** + * Creates a plain object from a VideoPayload message. Also converts values to other types if specified. + * @param message VideoPayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.VideoPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoPayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoPayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** StringAggregationType enum. */ + enum StringAggregationType { + STRING_AGGREGATION_TYPE_UNSPECIFIED = 0, + MAJORITY_VOTE = 1, + UNANIMOUS_VOTE = 2, + NO_AGGREGATION = 3 + } + + /** Properties of a HumanAnnotationConfig. */ + interface IHumanAnnotationConfig { + + /** HumanAnnotationConfig instruction */ + instruction?: (string|null); + + /** HumanAnnotationConfig annotatedDatasetDisplayName */ + annotatedDatasetDisplayName?: (string|null); + + /** HumanAnnotationConfig annotatedDatasetDescription */ + annotatedDatasetDescription?: (string|null); + + /** HumanAnnotationConfig labelGroup */ + labelGroup?: (string|null); + + /** HumanAnnotationConfig languageCode */ + languageCode?: (string|null); + + /** HumanAnnotationConfig replicaCount */ + replicaCount?: (number|null); + + /** HumanAnnotationConfig questionDuration */ + questionDuration?: (google.protobuf.IDuration|null); + + /** HumanAnnotationConfig contributorEmails */ + contributorEmails?: (string[]|null); + + /** HumanAnnotationConfig userEmailAddress */ + userEmailAddress?: (string|null); + } + + /** Represents a HumanAnnotationConfig. */ + class HumanAnnotationConfig implements IHumanAnnotationConfig { + + /** + * Constructs a new HumanAnnotationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig); + + /** HumanAnnotationConfig instruction. */ + public instruction: string; + + /** HumanAnnotationConfig annotatedDatasetDisplayName. */ + public annotatedDatasetDisplayName: string; + + /** HumanAnnotationConfig annotatedDatasetDescription. */ + public annotatedDatasetDescription: string; + + /** HumanAnnotationConfig labelGroup. */ + public labelGroup: string; + + /** HumanAnnotationConfig languageCode. */ + public languageCode: string; + + /** HumanAnnotationConfig replicaCount. */ + public replicaCount: number; + + /** HumanAnnotationConfig questionDuration. */ + public questionDuration?: (google.protobuf.IDuration|null); + + /** HumanAnnotationConfig contributorEmails. */ + public contributorEmails: string[]; + + /** HumanAnnotationConfig userEmailAddress. */ + public userEmailAddress: string; + + /** + * Creates a new HumanAnnotationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns HumanAnnotationConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig): google.cloud.datalabeling.v1beta1.HumanAnnotationConfig; + + /** + * Encodes the specified HumanAnnotationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify|verify} messages. + * @param message HumanAnnotationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HumanAnnotationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify|verify} messages. + * @param message HumanAnnotationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HumanAnnotationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HumanAnnotationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.HumanAnnotationConfig; + + /** + * Decodes a HumanAnnotationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HumanAnnotationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.HumanAnnotationConfig; + + /** + * Verifies a HumanAnnotationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HumanAnnotationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HumanAnnotationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.HumanAnnotationConfig; + + /** + * Creates a plain object from a HumanAnnotationConfig message. Also converts values to other types if specified. + * @param message HumanAnnotationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.HumanAnnotationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HumanAnnotationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HumanAnnotationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationConfig. */ + interface IImageClassificationConfig { + + /** ImageClassificationConfig annotationSpecSet */ + annotationSpecSet?: (string|null); + + /** ImageClassificationConfig allowMultiLabel */ + allowMultiLabel?: (boolean|null); + + /** ImageClassificationConfig answerAggregationType */ + answerAggregationType?: (google.cloud.datalabeling.v1beta1.StringAggregationType|keyof typeof google.cloud.datalabeling.v1beta1.StringAggregationType|null); + } + + /** Represents an ImageClassificationConfig. */ + class ImageClassificationConfig implements IImageClassificationConfig { + + /** + * Constructs a new ImageClassificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IImageClassificationConfig); + + /** ImageClassificationConfig annotationSpecSet. */ + public annotationSpecSet: string; + + /** ImageClassificationConfig allowMultiLabel. */ + public allowMultiLabel: boolean; + + /** ImageClassificationConfig answerAggregationType. */ + public answerAggregationType: (google.cloud.datalabeling.v1beta1.StringAggregationType|keyof typeof google.cloud.datalabeling.v1beta1.StringAggregationType); + + /** + * Creates a new ImageClassificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IImageClassificationConfig): google.cloud.datalabeling.v1beta1.ImageClassificationConfig; + + /** + * Encodes the specified ImageClassificationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageClassificationConfig.verify|verify} messages. + * @param message ImageClassificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IImageClassificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageClassificationConfig.verify|verify} messages. + * @param message ImageClassificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IImageClassificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ImageClassificationConfig; + + /** + * Decodes an ImageClassificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ImageClassificationConfig; + + /** + * Verifies an ImageClassificationConfig message. + * @param message Plain 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 ImageClassificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ImageClassificationConfig; + + /** + * Creates a plain object from an ImageClassificationConfig message. Also converts values to other types if specified. + * @param message ImageClassificationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ImageClassificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoundingPolyConfig. */ + interface IBoundingPolyConfig { + + /** BoundingPolyConfig annotationSpecSet */ + annotationSpecSet?: (string|null); + + /** BoundingPolyConfig instructionMessage */ + instructionMessage?: (string|null); + } + + /** Represents a BoundingPolyConfig. */ + class BoundingPolyConfig implements IBoundingPolyConfig { + + /** + * Constructs a new BoundingPolyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IBoundingPolyConfig); + + /** BoundingPolyConfig annotationSpecSet. */ + public annotationSpecSet: string; + + /** BoundingPolyConfig instructionMessage. */ + public instructionMessage: string; + + /** + * Creates a new BoundingPolyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPolyConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IBoundingPolyConfig): google.cloud.datalabeling.v1beta1.BoundingPolyConfig; + + /** + * Encodes the specified BoundingPolyConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingPolyConfig.verify|verify} messages. + * @param message BoundingPolyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IBoundingPolyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPolyConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingPolyConfig.verify|verify} messages. + * @param message BoundingPolyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IBoundingPolyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingPolyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingPolyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.BoundingPolyConfig; + + /** + * Decodes a BoundingPolyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingPolyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.BoundingPolyConfig; + + /** + * Verifies a BoundingPolyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingPolyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingPolyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.BoundingPolyConfig; + + /** + * Creates a plain object from a BoundingPolyConfig message. Also converts values to other types if specified. + * @param message BoundingPolyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.BoundingPolyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPolyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingPolyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PolylineConfig. */ + interface IPolylineConfig { + + /** PolylineConfig annotationSpecSet */ + annotationSpecSet?: (string|null); + + /** PolylineConfig instructionMessage */ + instructionMessage?: (string|null); + } + + /** Represents a PolylineConfig. */ + class PolylineConfig implements IPolylineConfig { + + /** + * Constructs a new PolylineConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IPolylineConfig); + + /** PolylineConfig annotationSpecSet. */ + public annotationSpecSet: string; + + /** PolylineConfig instructionMessage. */ + public instructionMessage: string; + + /** + * Creates a new PolylineConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PolylineConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IPolylineConfig): google.cloud.datalabeling.v1beta1.PolylineConfig; + + /** + * Encodes the specified PolylineConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PolylineConfig.verify|verify} messages. + * @param message PolylineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IPolylineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolylineConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PolylineConfig.verify|verify} messages. + * @param message PolylineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IPolylineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolylineConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolylineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.PolylineConfig; + + /** + * Decodes a PolylineConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolylineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.PolylineConfig; + + /** + * Verifies a PolylineConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolylineConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolylineConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.PolylineConfig; + + /** + * Creates a plain object from a PolylineConfig message. Also converts values to other types if specified. + * @param message PolylineConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.PolylineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolylineConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolylineConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentationConfig. */ + interface ISegmentationConfig { + + /** SegmentationConfig annotationSpecSet */ + annotationSpecSet?: (string|null); + + /** SegmentationConfig instructionMessage */ + instructionMessage?: (string|null); + } + + /** Represents a SegmentationConfig. */ + class SegmentationConfig implements ISegmentationConfig { + + /** + * Constructs a new SegmentationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ISegmentationConfig); + + /** SegmentationConfig annotationSpecSet. */ + public annotationSpecSet: string; + + /** SegmentationConfig instructionMessage. */ + public instructionMessage: string; + + /** + * Creates a new SegmentationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentationConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ISegmentationConfig): google.cloud.datalabeling.v1beta1.SegmentationConfig; + + /** + * Encodes the specified SegmentationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SegmentationConfig.verify|verify} messages. + * @param message SegmentationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ISegmentationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SegmentationConfig.verify|verify} messages. + * @param message SegmentationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ISegmentationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.SegmentationConfig; + + /** + * Decodes a SegmentationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.SegmentationConfig; + + /** + * Verifies a SegmentationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SegmentationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.SegmentationConfig; + + /** + * Creates a plain object from a SegmentationConfig message. Also converts values to other types if specified. + * @param message SegmentationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.SegmentationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoClassificationConfig. */ + interface IVideoClassificationConfig { + + /** VideoClassificationConfig annotationSpecSetConfigs */ + annotationSpecSetConfigs?: (google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig[]|null); + + /** VideoClassificationConfig applyShotDetection */ + applyShotDetection?: (boolean|null); + } + + /** Represents a VideoClassificationConfig. */ + class VideoClassificationConfig implements IVideoClassificationConfig { + + /** + * Constructs a new VideoClassificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IVideoClassificationConfig); + + /** VideoClassificationConfig annotationSpecSetConfigs. */ + public annotationSpecSetConfigs: google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig[]; + + /** VideoClassificationConfig applyShotDetection. */ + public applyShotDetection: boolean; + + /** + * Creates a new VideoClassificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoClassificationConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IVideoClassificationConfig): google.cloud.datalabeling.v1beta1.VideoClassificationConfig; + + /** + * Encodes the specified VideoClassificationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationConfig.verify|verify} messages. + * @param message VideoClassificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IVideoClassificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoClassificationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationConfig.verify|verify} messages. + * @param message VideoClassificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IVideoClassificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoClassificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.VideoClassificationConfig; + + /** + * Decodes a VideoClassificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.VideoClassificationConfig; + + /** + * Verifies a VideoClassificationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoClassificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoClassificationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.VideoClassificationConfig; + + /** + * Creates a plain object from a VideoClassificationConfig message. Also converts values to other types if specified. + * @param message VideoClassificationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.VideoClassificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoClassificationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoClassificationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VideoClassificationConfig { + + /** Properties of an AnnotationSpecSetConfig. */ + interface IAnnotationSpecSetConfig { + + /** AnnotationSpecSetConfig annotationSpecSet */ + annotationSpecSet?: (string|null); + + /** AnnotationSpecSetConfig allowMultiLabel */ + allowMultiLabel?: (boolean|null); + } + + /** Represents an AnnotationSpecSetConfig. */ + class AnnotationSpecSetConfig implements IAnnotationSpecSetConfig { + + /** + * Constructs a new AnnotationSpecSetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig); + + /** AnnotationSpecSetConfig annotationSpecSet. */ + public annotationSpecSet: string; + + /** AnnotationSpecSetConfig allowMultiLabel. */ + public allowMultiLabel: boolean; + + /** + * Creates a new AnnotationSpecSetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationSpecSetConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig): google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig; + + /** + * Encodes the specified AnnotationSpecSetConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.verify|verify} messages. + * @param message AnnotationSpecSetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationSpecSetConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.verify|verify} messages. + * @param message AnnotationSpecSetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationSpecSetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationSpecSetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig; + + /** + * Decodes an AnnotationSpecSetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationSpecSetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig; + + /** + * Verifies an AnnotationSpecSetConfig message. + * @param message Plain 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 AnnotationSpecSetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationSpecSetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig; + + /** + * Creates a plain object from an AnnotationSpecSetConfig message. Also converts values to other types if specified. + * @param message AnnotationSpecSetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationSpecSetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationSpecSetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ObjectDetectionConfig. */ + interface IObjectDetectionConfig { + + /** ObjectDetectionConfig annotationSpecSet */ + annotationSpecSet?: (string|null); + + /** ObjectDetectionConfig extractionFrameRate */ + extractionFrameRate?: (number|null); + } + + /** Represents an ObjectDetectionConfig. */ + class ObjectDetectionConfig implements IObjectDetectionConfig { + + /** + * Constructs a new ObjectDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IObjectDetectionConfig); + + /** ObjectDetectionConfig annotationSpecSet. */ + public annotationSpecSet: string; + + /** ObjectDetectionConfig extractionFrameRate. */ + public extractionFrameRate: number; + + /** + * Creates a new ObjectDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectDetectionConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IObjectDetectionConfig): google.cloud.datalabeling.v1beta1.ObjectDetectionConfig; + + /** + * Encodes the specified ObjectDetectionConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.verify|verify} messages. + * @param message ObjectDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IObjectDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.verify|verify} messages. + * @param message ObjectDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IObjectDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ObjectDetectionConfig; + + /** + * Decodes an ObjectDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ObjectDetectionConfig; + + /** + * Verifies an ObjectDetectionConfig message. + * @param message Plain 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 ObjectDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ObjectDetectionConfig; + + /** + * Creates a plain object from an ObjectDetectionConfig message. Also converts values to other types if specified. + * @param message ObjectDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ObjectDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectDetectionConfig + * @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 annotationSpecSet */ + annotationSpecSet?: (string|null); + } + + /** Represents an ObjectTrackingConfig. */ + class ObjectTrackingConfig implements IObjectTrackingConfig { + + /** + * Constructs a new ObjectTrackingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IObjectTrackingConfig); + + /** ObjectTrackingConfig annotationSpecSet. */ + public annotationSpecSet: string; + + /** + * Creates a new ObjectTrackingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IObjectTrackingConfig): google.cloud.datalabeling.v1beta1.ObjectTrackingConfig; + + /** + * Encodes the specified ObjectTrackingConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.IObjectTrackingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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 EventConfig. */ + interface IEventConfig { + + /** EventConfig annotationSpecSets */ + annotationSpecSets?: (string[]|null); + } + + /** Represents an EventConfig. */ + class EventConfig implements IEventConfig { + + /** + * Constructs a new EventConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IEventConfig); + + /** EventConfig annotationSpecSets. */ + public annotationSpecSets: string[]; + + /** + * Creates a new EventConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EventConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IEventConfig): google.cloud.datalabeling.v1beta1.EventConfig; + + /** + * Encodes the specified EventConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EventConfig.verify|verify} messages. + * @param message EventConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IEventConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EventConfig.verify|verify} messages. + * @param message EventConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IEventConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.EventConfig; + + /** + * Decodes an EventConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.EventConfig; + + /** + * Verifies an EventConfig message. + * @param message Plain 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 EventConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.EventConfig; + + /** + * Creates a plain object from an EventConfig message. Also converts values to other types if specified. + * @param message EventConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.EventConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationConfig. */ + interface ITextClassificationConfig { + + /** TextClassificationConfig allowMultiLabel */ + allowMultiLabel?: (boolean|null); + + /** TextClassificationConfig annotationSpecSet */ + annotationSpecSet?: (string|null); + + /** TextClassificationConfig sentimentConfig */ + sentimentConfig?: (google.cloud.datalabeling.v1beta1.ISentimentConfig|null); + } + + /** Represents a TextClassificationConfig. */ + class TextClassificationConfig implements ITextClassificationConfig { + + /** + * Constructs a new TextClassificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ITextClassificationConfig); + + /** TextClassificationConfig allowMultiLabel. */ + public allowMultiLabel: boolean; + + /** TextClassificationConfig annotationSpecSet. */ + public annotationSpecSet: string; + + /** TextClassificationConfig sentimentConfig. */ + public sentimentConfig?: (google.cloud.datalabeling.v1beta1.ISentimentConfig|null); + + /** + * Creates a new TextClassificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ITextClassificationConfig): google.cloud.datalabeling.v1beta1.TextClassificationConfig; + + /** + * Encodes the specified TextClassificationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextClassificationConfig.verify|verify} messages. + * @param message TextClassificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ITextClassificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextClassificationConfig.verify|verify} messages. + * @param message TextClassificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ITextClassificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.TextClassificationConfig; + + /** + * Decodes a TextClassificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.TextClassificationConfig; + + /** + * Verifies a TextClassificationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.TextClassificationConfig; + + /** + * Creates a plain object from a TextClassificationConfig message. Also converts values to other types if specified. + * @param message TextClassificationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.TextClassificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SentimentConfig. */ + interface ISentimentConfig { + + /** SentimentConfig enableLabelSentimentSelection */ + enableLabelSentimentSelection?: (boolean|null); + } + + /** Represents a SentimentConfig. */ + class SentimentConfig implements ISentimentConfig { + + /** + * Constructs a new SentimentConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ISentimentConfig); + + /** SentimentConfig enableLabelSentimentSelection. */ + public enableLabelSentimentSelection: boolean; + + /** + * Creates a new SentimentConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SentimentConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ISentimentConfig): google.cloud.datalabeling.v1beta1.SentimentConfig; + + /** + * Encodes the specified SentimentConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SentimentConfig.verify|verify} messages. + * @param message SentimentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ISentimentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SentimentConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SentimentConfig.verify|verify} messages. + * @param message SentimentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ISentimentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SentimentConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SentimentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.SentimentConfig; + + /** + * Decodes a SentimentConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SentimentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.SentimentConfig; + + /** + * Verifies a SentimentConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SentimentConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SentimentConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.SentimentConfig; + + /** + * Creates a plain object from a SentimentConfig message. Also converts values to other types if specified. + * @param message SentimentConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.SentimentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SentimentConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SentimentConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextEntityExtractionConfig. */ + interface ITextEntityExtractionConfig { + + /** TextEntityExtractionConfig annotationSpecSet */ + annotationSpecSet?: (string|null); + } + + /** Represents a TextEntityExtractionConfig. */ + class TextEntityExtractionConfig implements ITextEntityExtractionConfig { + + /** + * Constructs a new TextEntityExtractionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig); + + /** TextEntityExtractionConfig annotationSpecSet. */ + public annotationSpecSet: string; + + /** + * Creates a new TextEntityExtractionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TextEntityExtractionConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig): google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig; + + /** + * Encodes the specified TextEntityExtractionConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.verify|verify} messages. + * @param message TextEntityExtractionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextEntityExtractionConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.verify|verify} messages. + * @param message TextEntityExtractionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextEntityExtractionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextEntityExtractionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig; + + /** + * Decodes a TextEntityExtractionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextEntityExtractionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig; + + /** + * Verifies a TextEntityExtractionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextEntityExtractionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextEntityExtractionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig; + + /** + * Creates a plain object from a TextEntityExtractionConfig message. Also converts values to other types if specified. + * @param message TextEntityExtractionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextEntityExtractionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextEntityExtractionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Evaluation. */ + interface IEvaluation { + + /** Evaluation name */ + name?: (string|null); + + /** Evaluation config */ + config?: (google.cloud.datalabeling.v1beta1.IEvaluationConfig|null); + + /** Evaluation evaluationJobRunTime */ + evaluationJobRunTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation evaluationMetrics */ + evaluationMetrics?: (google.cloud.datalabeling.v1beta1.IEvaluationMetrics|null); + + /** Evaluation annotationType */ + annotationType?: (google.cloud.datalabeling.v1beta1.AnnotationType|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationType|null); + + /** Evaluation evaluatedItemCount */ + evaluatedItemCount?: (number|Long|string|null); + } + + /** Represents an Evaluation. */ + class Evaluation implements IEvaluation { + + /** + * Constructs a new Evaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IEvaluation); + + /** Evaluation name. */ + public name: string; + + /** Evaluation config. */ + public config?: (google.cloud.datalabeling.v1beta1.IEvaluationConfig|null); + + /** Evaluation evaluationJobRunTime. */ + public evaluationJobRunTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation evaluationMetrics. */ + public evaluationMetrics?: (google.cloud.datalabeling.v1beta1.IEvaluationMetrics|null); + + /** Evaluation annotationType. */ + public annotationType: (google.cloud.datalabeling.v1beta1.AnnotationType|keyof typeof google.cloud.datalabeling.v1beta1.AnnotationType); + + /** Evaluation evaluatedItemCount. */ + public evaluatedItemCount: (number|Long|string); + + /** + * Creates a new Evaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns Evaluation instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IEvaluation): google.cloud.datalabeling.v1beta1.Evaluation; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.Evaluation; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.Evaluation; + + /** + * Verifies an Evaluation message. + * @param message Plain 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 Evaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Evaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.Evaluation; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @param message Evaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.Evaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Evaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Evaluation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationConfig. */ + interface IEvaluationConfig { + + /** EvaluationConfig boundingBoxEvaluationOptions */ + boundingBoxEvaluationOptions?: (google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions|null); + } + + /** Represents an EvaluationConfig. */ + class EvaluationConfig implements IEvaluationConfig { + + /** + * Constructs a new EvaluationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IEvaluationConfig); + + /** EvaluationConfig boundingBoxEvaluationOptions. */ + public boundingBoxEvaluationOptions?: (google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions|null); + + /** EvaluationConfig verticalOption. */ + public verticalOption?: "boundingBoxEvaluationOptions"; + + /** + * Creates a new EvaluationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IEvaluationConfig): google.cloud.datalabeling.v1beta1.EvaluationConfig; + + /** + * Encodes the specified EvaluationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationConfig.verify|verify} messages. + * @param message EvaluationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IEvaluationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationConfig.verify|verify} messages. + * @param message EvaluationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IEvaluationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.EvaluationConfig; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.EvaluationConfig; + + /** + * Verifies an EvaluationConfig message. + * @param message Plain 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 EvaluationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.EvaluationConfig; + + /** + * Creates a plain object from an EvaluationConfig message. Also converts values to other types if specified. + * @param message EvaluationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.EvaluationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoundingBoxEvaluationOptions. */ + interface IBoundingBoxEvaluationOptions { + + /** BoundingBoxEvaluationOptions iouThreshold */ + iouThreshold?: (number|null); + } + + /** Represents a BoundingBoxEvaluationOptions. */ + class BoundingBoxEvaluationOptions implements IBoundingBoxEvaluationOptions { + + /** + * Constructs a new BoundingBoxEvaluationOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions); + + /** BoundingBoxEvaluationOptions iouThreshold. */ + public iouThreshold: number; + + /** + * Creates a new BoundingBoxEvaluationOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingBoxEvaluationOptions instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions): google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions; + + /** + * Encodes the specified BoundingBoxEvaluationOptions message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.verify|verify} messages. + * @param message BoundingBoxEvaluationOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingBoxEvaluationOptions message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.verify|verify} messages. + * @param message BoundingBoxEvaluationOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingBoxEvaluationOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingBoxEvaluationOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions; + + /** + * Decodes a BoundingBoxEvaluationOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingBoxEvaluationOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions; + + /** + * Verifies a BoundingBoxEvaluationOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingBoxEvaluationOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingBoxEvaluationOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions; + + /** + * Creates a plain object from a BoundingBoxEvaluationOptions message. Also converts values to other types if specified. + * @param message BoundingBoxEvaluationOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingBoxEvaluationOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingBoxEvaluationOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationMetrics. */ + interface IEvaluationMetrics { + + /** EvaluationMetrics classificationMetrics */ + classificationMetrics?: (google.cloud.datalabeling.v1beta1.IClassificationMetrics|null); + + /** EvaluationMetrics objectDetectionMetrics */ + objectDetectionMetrics?: (google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics|null); + } + + /** Represents an EvaluationMetrics. */ + class EvaluationMetrics implements IEvaluationMetrics { + + /** + * Constructs a new EvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IEvaluationMetrics); + + /** EvaluationMetrics classificationMetrics. */ + public classificationMetrics?: (google.cloud.datalabeling.v1beta1.IClassificationMetrics|null); + + /** EvaluationMetrics objectDetectionMetrics. */ + public objectDetectionMetrics?: (google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics|null); + + /** EvaluationMetrics metrics. */ + public metrics?: ("classificationMetrics"|"objectDetectionMetrics"); + + /** + * Creates a new EvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationMetrics instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IEvaluationMetrics): google.cloud.datalabeling.v1beta1.EvaluationMetrics; + + /** + * Encodes the specified EvaluationMetrics message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationMetrics.verify|verify} messages. + * @param message EvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationMetrics.verify|verify} messages. + * @param message EvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.EvaluationMetrics; + + /** + * Decodes an EvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.EvaluationMetrics; + + /** + * Verifies an EvaluationMetrics message. + * @param message Plain 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 EvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.EvaluationMetrics; + + /** + * Creates a plain object from an EvaluationMetrics message. Also converts values to other types if specified. + * @param message EvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.EvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationMetrics. */ + interface IClassificationMetrics { + + /** ClassificationMetrics prCurve */ + prCurve?: (google.cloud.datalabeling.v1beta1.IPrCurve|null); + + /** ClassificationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.datalabeling.v1beta1.IConfusionMatrix|null); + } + + /** Represents a ClassificationMetrics. */ + class ClassificationMetrics implements IClassificationMetrics { + + /** + * Constructs a new ClassificationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IClassificationMetrics); + + /** ClassificationMetrics prCurve. */ + public prCurve?: (google.cloud.datalabeling.v1beta1.IPrCurve|null); + + /** ClassificationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.datalabeling.v1beta1.IConfusionMatrix|null); + + /** + * Creates a new ClassificationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationMetrics instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IClassificationMetrics): google.cloud.datalabeling.v1beta1.ClassificationMetrics; + + /** + * Encodes the specified ClassificationMetrics message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ClassificationMetrics.verify|verify} messages. + * @param message ClassificationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IClassificationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationMetrics message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ClassificationMetrics.verify|verify} messages. + * @param message ClassificationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IClassificationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ClassificationMetrics; + + /** + * Decodes a ClassificationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ClassificationMetrics; + + /** + * Verifies a ClassificationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ClassificationMetrics; + + /** + * Creates a plain object from a ClassificationMetrics message. Also converts values to other types if specified. + * @param message ClassificationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ClassificationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectDetectionMetrics. */ + interface IObjectDetectionMetrics { + + /** ObjectDetectionMetrics prCurve */ + prCurve?: (google.cloud.datalabeling.v1beta1.IPrCurve|null); + } + + /** Represents an ObjectDetectionMetrics. */ + class ObjectDetectionMetrics implements IObjectDetectionMetrics { + + /** + * Constructs a new ObjectDetectionMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics); + + /** ObjectDetectionMetrics prCurve. */ + public prCurve?: (google.cloud.datalabeling.v1beta1.IPrCurve|null); + + /** + * Creates a new ObjectDetectionMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectDetectionMetrics instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics): google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics; + + /** + * Encodes the specified ObjectDetectionMetrics message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.verify|verify} messages. + * @param message ObjectDetectionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectDetectionMetrics message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.verify|verify} messages. + * @param message ObjectDetectionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectDetectionMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectDetectionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics; + + /** + * Decodes an ObjectDetectionMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectDetectionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics; + + /** + * Verifies an ObjectDetectionMetrics message. + * @param message Plain 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 ObjectDetectionMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectDetectionMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics; + + /** + * Creates a plain object from an ObjectDetectionMetrics message. Also converts values to other types if specified. + * @param message ObjectDetectionMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectDetectionMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectDetectionMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrCurve. */ + interface IPrCurve { + + /** PrCurve annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** PrCurve areaUnderCurve */ + areaUnderCurve?: (number|null); + + /** PrCurve confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry[]|null); + + /** PrCurve meanAveragePrecision */ + meanAveragePrecision?: (number|null); + } + + /** Represents a PrCurve. */ + class PrCurve implements IPrCurve { + + /** + * Constructs a new PrCurve. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IPrCurve); + + /** PrCurve annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** PrCurve areaUnderCurve. */ + public areaUnderCurve: number; + + /** PrCurve confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry[]; + + /** PrCurve meanAveragePrecision. */ + public meanAveragePrecision: number; + + /** + * Creates a new PrCurve instance using the specified properties. + * @param [properties] Properties to set + * @returns PrCurve instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IPrCurve): google.cloud.datalabeling.v1beta1.PrCurve; + + /** + * Encodes the specified PrCurve message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PrCurve.verify|verify} messages. + * @param message PrCurve message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IPrCurve, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrCurve message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PrCurve.verify|verify} messages. + * @param message PrCurve message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IPrCurve, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrCurve message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrCurve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.PrCurve; + + /** + * Decodes a PrCurve message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrCurve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.PrCurve; + + /** + * Verifies a PrCurve message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrCurve message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrCurve + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.PrCurve; + + /** + * Creates a plain object from a PrCurve message. Also converts values to other types if specified. + * @param message PrCurve + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.PrCurve, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrCurve to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrCurve + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PrCurve { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + + /** ConfidenceMetricsEntry recallAt1 */ + recallAt1?: (number|null); + + /** ConfidenceMetricsEntry precisionAt1 */ + precisionAt1?: (number|null); + + /** ConfidenceMetricsEntry f1ScoreAt1 */ + f1ScoreAt1?: (number|null); + + /** ConfidenceMetricsEntry recallAt5 */ + recallAt5?: (number|null); + + /** ConfidenceMetricsEntry precisionAt5 */ + precisionAt5?: (number|null); + + /** ConfidenceMetricsEntry f1ScoreAt5 */ + f1ScoreAt5?: (number|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** ConfidenceMetricsEntry recallAt1. */ + public recallAt1: number; + + /** ConfidenceMetricsEntry precisionAt1. */ + public precisionAt1: number; + + /** ConfidenceMetricsEntry f1ScoreAt1. */ + public f1ScoreAt1: number; + + /** ConfidenceMetricsEntry recallAt5. */ + public recallAt5: number; + + /** ConfidenceMetricsEntry precisionAt5. */ + public precisionAt5: number; + + /** ConfidenceMetricsEntry f1ScoreAt5. */ + public f1ScoreAt5: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry): google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ConfusionMatrix. */ + interface IConfusionMatrix { + + /** ConfusionMatrix row */ + row?: (google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow[]|null); + } + + /** Represents a ConfusionMatrix. */ + class ConfusionMatrix implements IConfusionMatrix { + + /** + * Constructs a new ConfusionMatrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IConfusionMatrix); + + /** ConfusionMatrix row. */ + public row: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow[]; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfusionMatrix instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IConfusionMatrix): google.cloud.datalabeling.v1beta1.ConfusionMatrix; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ConfusionMatrix; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ConfusionMatrix; + + /** + * Verifies a ConfusionMatrix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfusionMatrix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ConfusionMatrix; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @param message ConfusionMatrix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ConfusionMatrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfusionMatrix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfusionMatrix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConfusionMatrix { + + /** Properties of a ConfusionMatrixEntry. */ + interface IConfusionMatrixEntry { + + /** ConfusionMatrixEntry annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** ConfusionMatrixEntry itemCount */ + itemCount?: (number|null); + } + + /** Represents a ConfusionMatrixEntry. */ + class ConfusionMatrixEntry implements IConfusionMatrixEntry { + + /** + * Constructs a new ConfusionMatrixEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry); + + /** ConfusionMatrixEntry annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** ConfusionMatrixEntry itemCount. */ + public itemCount: number; + + /** + * Creates a new ConfusionMatrixEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfusionMatrixEntry instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry): google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry; + + /** + * Encodes the specified ConfusionMatrixEntry message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.verify|verify} messages. + * @param message ConfusionMatrixEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfusionMatrixEntry message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.verify|verify} messages. + * @param message ConfusionMatrixEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfusionMatrixEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfusionMatrixEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry; + + /** + * Decodes a ConfusionMatrixEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfusionMatrixEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry; + + /** + * Verifies a ConfusionMatrixEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfusionMatrixEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfusionMatrixEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry; + + /** + * Creates a plain object from a ConfusionMatrixEntry message. Also converts values to other types if specified. + * @param message ConfusionMatrixEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfusionMatrixEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfusionMatrixEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Row. */ + interface IRow { + + /** Row annotationSpec */ + annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** Row entries */ + entries?: (google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow); + + /** Row annotationSpec. */ + public annotationSpec?: (google.cloud.datalabeling.v1beta1.IAnnotationSpec|null); + + /** Row entries. */ + public entries: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow): google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EvaluationJob. */ + interface IEvaluationJob { + + /** EvaluationJob name */ + name?: (string|null); + + /** EvaluationJob description */ + description?: (string|null); + + /** EvaluationJob state */ + state?: (google.cloud.datalabeling.v1beta1.EvaluationJob.State|keyof typeof google.cloud.datalabeling.v1beta1.EvaluationJob.State|null); + + /** EvaluationJob schedule */ + schedule?: (string|null); + + /** EvaluationJob modelVersion */ + modelVersion?: (string|null); + + /** EvaluationJob evaluationJobConfig */ + evaluationJobConfig?: (google.cloud.datalabeling.v1beta1.IEvaluationJobConfig|null); + + /** EvaluationJob annotationSpecSet */ + annotationSpecSet?: (string|null); + + /** EvaluationJob labelMissingGroundTruth */ + labelMissingGroundTruth?: (boolean|null); + + /** EvaluationJob attempts */ + attempts?: (google.cloud.datalabeling.v1beta1.IAttempt[]|null); + + /** EvaluationJob createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an EvaluationJob. */ + class EvaluationJob implements IEvaluationJob { + + /** + * Constructs a new EvaluationJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IEvaluationJob); + + /** EvaluationJob name. */ + public name: string; + + /** EvaluationJob description. */ + public description: string; + + /** EvaluationJob state. */ + public state: (google.cloud.datalabeling.v1beta1.EvaluationJob.State|keyof typeof google.cloud.datalabeling.v1beta1.EvaluationJob.State); + + /** EvaluationJob schedule. */ + public schedule: string; + + /** EvaluationJob modelVersion. */ + public modelVersion: string; + + /** EvaluationJob evaluationJobConfig. */ + public evaluationJobConfig?: (google.cloud.datalabeling.v1beta1.IEvaluationJobConfig|null); + + /** EvaluationJob annotationSpecSet. */ + public annotationSpecSet: string; + + /** EvaluationJob labelMissingGroundTruth. */ + public labelMissingGroundTruth: boolean; + + /** EvaluationJob attempts. */ + public attempts: google.cloud.datalabeling.v1beta1.IAttempt[]; + + /** EvaluationJob createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new EvaluationJob instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationJob instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IEvaluationJob): google.cloud.datalabeling.v1beta1.EvaluationJob; + + /** + * Encodes the specified EvaluationJob message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJob.verify|verify} messages. + * @param message EvaluationJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IEvaluationJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationJob message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJob.verify|verify} messages. + * @param message EvaluationJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IEvaluationJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.EvaluationJob; + + /** + * Decodes an EvaluationJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.EvaluationJob; + + /** + * Verifies an EvaluationJob message. + * @param message Plain 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 EvaluationJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.EvaluationJob; + + /** + * Creates a plain object from an EvaluationJob message. Also converts values to other types if specified. + * @param message EvaluationJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.EvaluationJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationJob { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SCHEDULED = 1, + RUNNING = 2, + PAUSED = 3, + STOPPED = 4 + } + } + + /** Properties of an EvaluationJobConfig. */ + interface IEvaluationJobConfig { + + /** EvaluationJobConfig imageClassificationConfig */ + imageClassificationConfig?: (google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null); + + /** EvaluationJobConfig boundingPolyConfig */ + boundingPolyConfig?: (google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null); + + /** EvaluationJobConfig textClassificationConfig */ + textClassificationConfig?: (google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null); + + /** EvaluationJobConfig inputConfig */ + inputConfig?: (google.cloud.datalabeling.v1beta1.IInputConfig|null); + + /** EvaluationJobConfig evaluationConfig */ + evaluationConfig?: (google.cloud.datalabeling.v1beta1.IEvaluationConfig|null); + + /** EvaluationJobConfig humanAnnotationConfig */ + humanAnnotationConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** EvaluationJobConfig bigqueryImportKeys */ + bigqueryImportKeys?: ({ [k: string]: string }|null); + + /** EvaluationJobConfig exampleCount */ + exampleCount?: (number|null); + + /** EvaluationJobConfig exampleSamplePercentage */ + exampleSamplePercentage?: (number|null); + + /** EvaluationJobConfig evaluationJobAlertConfig */ + evaluationJobAlertConfig?: (google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig|null); + } + + /** Represents an EvaluationJobConfig. */ + class EvaluationJobConfig implements IEvaluationJobConfig { + + /** + * Constructs a new EvaluationJobConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IEvaluationJobConfig); + + /** EvaluationJobConfig imageClassificationConfig. */ + public imageClassificationConfig?: (google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null); + + /** EvaluationJobConfig boundingPolyConfig. */ + public boundingPolyConfig?: (google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null); + + /** EvaluationJobConfig textClassificationConfig. */ + public textClassificationConfig?: (google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null); + + /** EvaluationJobConfig inputConfig. */ + public inputConfig?: (google.cloud.datalabeling.v1beta1.IInputConfig|null); + + /** EvaluationJobConfig evaluationConfig. */ + public evaluationConfig?: (google.cloud.datalabeling.v1beta1.IEvaluationConfig|null); + + /** EvaluationJobConfig humanAnnotationConfig. */ + public humanAnnotationConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** EvaluationJobConfig bigqueryImportKeys. */ + public bigqueryImportKeys: { [k: string]: string }; + + /** EvaluationJobConfig exampleCount. */ + public exampleCount: number; + + /** EvaluationJobConfig exampleSamplePercentage. */ + public exampleSamplePercentage: number; + + /** EvaluationJobConfig evaluationJobAlertConfig. */ + public evaluationJobAlertConfig?: (google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig|null); + + /** EvaluationJobConfig humanAnnotationRequestConfig. */ + public humanAnnotationRequestConfig?: ("imageClassificationConfig"|"boundingPolyConfig"|"textClassificationConfig"); + + /** + * Creates a new EvaluationJobConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationJobConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IEvaluationJobConfig): google.cloud.datalabeling.v1beta1.EvaluationJobConfig; + + /** + * Encodes the specified EvaluationJobConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJobConfig.verify|verify} messages. + * @param message EvaluationJobConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IEvaluationJobConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationJobConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJobConfig.verify|verify} messages. + * @param message EvaluationJobConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IEvaluationJobConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationJobConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationJobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.EvaluationJobConfig; + + /** + * Decodes an EvaluationJobConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationJobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.EvaluationJobConfig; + + /** + * Verifies an EvaluationJobConfig message. + * @param message Plain 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 EvaluationJobConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationJobConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.EvaluationJobConfig; + + /** + * Creates a plain object from an EvaluationJobConfig message. Also converts values to other types if specified. + * @param message EvaluationJobConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.EvaluationJobConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationJobConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationJobConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationJobAlertConfig. */ + interface IEvaluationJobAlertConfig { + + /** EvaluationJobAlertConfig email */ + email?: (string|null); + + /** EvaluationJobAlertConfig minAcceptableMeanAveragePrecision */ + minAcceptableMeanAveragePrecision?: (number|null); + } + + /** Represents an EvaluationJobAlertConfig. */ + class EvaluationJobAlertConfig implements IEvaluationJobAlertConfig { + + /** + * Constructs a new EvaluationJobAlertConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig); + + /** EvaluationJobAlertConfig email. */ + public email: string; + + /** EvaluationJobAlertConfig minAcceptableMeanAveragePrecision. */ + public minAcceptableMeanAveragePrecision: number; + + /** + * Creates a new EvaluationJobAlertConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationJobAlertConfig instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig): google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig; + + /** + * Encodes the specified EvaluationJobAlertConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig.verify|verify} messages. + * @param message EvaluationJobAlertConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationJobAlertConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig.verify|verify} messages. + * @param message EvaluationJobAlertConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationJobAlertConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationJobAlertConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig; + + /** + * Decodes an EvaluationJobAlertConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationJobAlertConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig; + + /** + * Verifies an EvaluationJobAlertConfig message. + * @param message Plain 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 EvaluationJobAlertConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationJobAlertConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig; + + /** + * Creates a plain object from an EvaluationJobAlertConfig message. Also converts values to other types if specified. + * @param message EvaluationJobAlertConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationJobAlertConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationJobAlertConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Attempt. */ + interface IAttempt { + + /** Attempt attemptTime */ + attemptTime?: (google.protobuf.ITimestamp|null); + + /** Attempt partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + } + + /** Represents an Attempt. */ + class Attempt implements IAttempt { + + /** + * Constructs a new Attempt. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IAttempt); + + /** Attempt attemptTime. */ + public attemptTime?: (google.protobuf.ITimestamp|null); + + /** Attempt partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** + * Creates a new Attempt instance using the specified properties. + * @param [properties] Properties to set + * @returns Attempt instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IAttempt): google.cloud.datalabeling.v1beta1.Attempt; + + /** + * Encodes the specified Attempt message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Attempt.verify|verify} messages. + * @param message Attempt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IAttempt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attempt message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Attempt.verify|verify} messages. + * @param message Attempt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IAttempt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Attempt message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Attempt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.Attempt; + + /** + * Decodes an Attempt message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Attempt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.Attempt; + + /** + * Verifies an Attempt message. + * @param message Plain 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 Attempt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Attempt + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.Attempt; + + /** + * Creates a plain object from an Attempt message. Also converts values to other types if specified. + * @param message Attempt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.Attempt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Attempt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attempt + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Instruction. */ + interface IInstruction { + + /** Instruction name */ + name?: (string|null); + + /** Instruction displayName */ + displayName?: (string|null); + + /** Instruction description */ + description?: (string|null); + + /** Instruction createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instruction updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instruction dataType */ + dataType?: (google.cloud.datalabeling.v1beta1.DataType|keyof typeof google.cloud.datalabeling.v1beta1.DataType|null); + + /** Instruction csvInstruction */ + csvInstruction?: (google.cloud.datalabeling.v1beta1.ICsvInstruction|null); + + /** Instruction pdfInstruction */ + pdfInstruction?: (google.cloud.datalabeling.v1beta1.IPdfInstruction|null); + + /** Instruction blockingResources */ + blockingResources?: (string[]|null); + } + + /** Represents an Instruction. */ + class Instruction implements IInstruction { + + /** + * Constructs a new Instruction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IInstruction); + + /** Instruction name. */ + public name: string; + + /** Instruction displayName. */ + public displayName: string; + + /** Instruction description. */ + public description: string; + + /** Instruction createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instruction updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instruction dataType. */ + public dataType: (google.cloud.datalabeling.v1beta1.DataType|keyof typeof google.cloud.datalabeling.v1beta1.DataType); + + /** Instruction csvInstruction. */ + public csvInstruction?: (google.cloud.datalabeling.v1beta1.ICsvInstruction|null); + + /** Instruction pdfInstruction. */ + public pdfInstruction?: (google.cloud.datalabeling.v1beta1.IPdfInstruction|null); + + /** Instruction blockingResources. */ + public blockingResources: string[]; + + /** + * Creates a new Instruction instance using the specified properties. + * @param [properties] Properties to set + * @returns Instruction instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IInstruction): google.cloud.datalabeling.v1beta1.Instruction; + + /** + * Encodes the specified Instruction message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Instruction.verify|verify} messages. + * @param message Instruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instruction message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Instruction.verify|verify} messages. + * @param message Instruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instruction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.Instruction; + + /** + * Decodes an Instruction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.Instruction; + + /** + * Verifies an Instruction message. + * @param message Plain 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 Instruction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instruction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.Instruction; + + /** + * Creates a plain object from an Instruction message. Also converts values to other types if specified. + * @param message Instruction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.Instruction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instruction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instruction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CsvInstruction. */ + interface ICsvInstruction { + + /** CsvInstruction gcsFileUri */ + gcsFileUri?: (string|null); + } + + /** Represents a CsvInstruction. */ + class CsvInstruction implements ICsvInstruction { + + /** + * Constructs a new CsvInstruction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ICsvInstruction); + + /** CsvInstruction gcsFileUri. */ + public gcsFileUri: string; + + /** + * Creates a new CsvInstruction instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvInstruction instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ICsvInstruction): google.cloud.datalabeling.v1beta1.CsvInstruction; + + /** + * Encodes the specified CsvInstruction message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CsvInstruction.verify|verify} messages. + * @param message CsvInstruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ICsvInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvInstruction message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CsvInstruction.verify|verify} messages. + * @param message CsvInstruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ICsvInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvInstruction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.CsvInstruction; + + /** + * Decodes a CsvInstruction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.CsvInstruction; + + /** + * Verifies a CsvInstruction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvInstruction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvInstruction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.CsvInstruction; + + /** + * Creates a plain object from a CsvInstruction message. Also converts values to other types if specified. + * @param message CsvInstruction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.CsvInstruction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvInstruction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvInstruction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PdfInstruction. */ + interface IPdfInstruction { + + /** PdfInstruction gcsFileUri */ + gcsFileUri?: (string|null); + } + + /** Represents a PdfInstruction. */ + class PdfInstruction implements IPdfInstruction { + + /** + * Constructs a new PdfInstruction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IPdfInstruction); + + /** PdfInstruction gcsFileUri. */ + public gcsFileUri: string; + + /** + * Creates a new PdfInstruction instance using the specified properties. + * @param [properties] Properties to set + * @returns PdfInstruction instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IPdfInstruction): google.cloud.datalabeling.v1beta1.PdfInstruction; + + /** + * Encodes the specified PdfInstruction message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PdfInstruction.verify|verify} messages. + * @param message PdfInstruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IPdfInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PdfInstruction message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PdfInstruction.verify|verify} messages. + * @param message PdfInstruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IPdfInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PdfInstruction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PdfInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.PdfInstruction; + + /** + * Decodes a PdfInstruction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PdfInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.PdfInstruction; + + /** + * Verifies a PdfInstruction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PdfInstruction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PdfInstruction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.PdfInstruction; + + /** + * Creates a plain object from a PdfInstruction message. Also converts values to other types if specified. + * @param message PdfInstruction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.PdfInstruction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PdfInstruction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PdfInstruction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataOperationResponse. */ + interface IImportDataOperationResponse { + + /** ImportDataOperationResponse dataset */ + dataset?: (string|null); + + /** ImportDataOperationResponse totalCount */ + totalCount?: (number|null); + + /** ImportDataOperationResponse importCount */ + importCount?: (number|null); + } + + /** Represents an ImportDataOperationResponse. */ + class ImportDataOperationResponse implements IImportDataOperationResponse { + + /** + * Constructs a new ImportDataOperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IImportDataOperationResponse); + + /** ImportDataOperationResponse dataset. */ + public dataset: string; + + /** ImportDataOperationResponse totalCount. */ + public totalCount: number; + + /** ImportDataOperationResponse importCount. */ + public importCount: number; + + /** + * Creates a new ImportDataOperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataOperationResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IImportDataOperationResponse): google.cloud.datalabeling.v1beta1.ImportDataOperationResponse; + + /** + * Encodes the specified ImportDataOperationResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.verify|verify} messages. + * @param message ImportDataOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataOperationResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.verify|verify} messages. + * @param message ImportDataOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataOperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ImportDataOperationResponse; + + /** + * Decodes an ImportDataOperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ImportDataOperationResponse; + + /** + * Verifies an ImportDataOperationResponse message. + * @param message Plain 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 ImportDataOperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataOperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ImportDataOperationResponse; + + /** + * Creates a plain object from an ImportDataOperationResponse message. Also converts values to other types if specified. + * @param message ImportDataOperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ImportDataOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataOperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataOperationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataOperationResponse. */ + interface IExportDataOperationResponse { + + /** ExportDataOperationResponse dataset */ + dataset?: (string|null); + + /** ExportDataOperationResponse totalCount */ + totalCount?: (number|null); + + /** ExportDataOperationResponse exportCount */ + exportCount?: (number|null); + + /** ExportDataOperationResponse labelStats */ + labelStats?: (google.cloud.datalabeling.v1beta1.ILabelStats|null); + + /** ExportDataOperationResponse outputConfig */ + outputConfig?: (google.cloud.datalabeling.v1beta1.IOutputConfig|null); + } + + /** Represents an ExportDataOperationResponse. */ + class ExportDataOperationResponse implements IExportDataOperationResponse { + + /** + * Constructs a new ExportDataOperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IExportDataOperationResponse); + + /** ExportDataOperationResponse dataset. */ + public dataset: string; + + /** ExportDataOperationResponse totalCount. */ + public totalCount: number; + + /** ExportDataOperationResponse exportCount. */ + public exportCount: number; + + /** ExportDataOperationResponse labelStats. */ + public labelStats?: (google.cloud.datalabeling.v1beta1.ILabelStats|null); + + /** ExportDataOperationResponse outputConfig. */ + public outputConfig?: (google.cloud.datalabeling.v1beta1.IOutputConfig|null); + + /** + * Creates a new ExportDataOperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOperationResponse instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IExportDataOperationResponse): google.cloud.datalabeling.v1beta1.ExportDataOperationResponse; + + /** + * Encodes the specified ExportDataOperationResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.verify|verify} messages. + * @param message ExportDataOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOperationResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.verify|verify} messages. + * @param message ExportDataOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ExportDataOperationResponse; + + /** + * Decodes an ExportDataOperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ExportDataOperationResponse; + + /** + * Verifies an ExportDataOperationResponse message. + * @param message Plain 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 ExportDataOperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ExportDataOperationResponse; + + /** + * Creates a plain object from an ExportDataOperationResponse message. Also converts values to other types if specified. + * @param message ExportDataOperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ExportDataOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataOperationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataOperationMetadata. */ + interface IImportDataOperationMetadata { + + /** ImportDataOperationMetadata dataset */ + dataset?: (string|null); + + /** ImportDataOperationMetadata partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + + /** ImportDataOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ImportDataOperationMetadata. */ + class ImportDataOperationMetadata implements IImportDataOperationMetadata { + + /** + * Constructs a new ImportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata); + + /** ImportDataOperationMetadata dataset. */ + public dataset: string; + + /** ImportDataOperationMetadata partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** ImportDataOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ImportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata): google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @param message ImportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @param message ImportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata; + + /** + * Verifies an ImportDataOperationMetadata message. + * @param message Plain 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 ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata; + + /** + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. + * @param message ImportDataOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataOperationMetadata. */ + interface IExportDataOperationMetadata { + + /** ExportDataOperationMetadata dataset */ + dataset?: (string|null); + + /** ExportDataOperationMetadata partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + + /** ExportDataOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ExportDataOperationMetadata. */ + class ExportDataOperationMetadata implements IExportDataOperationMetadata { + + /** + * Constructs a new ExportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata); + + /** ExportDataOperationMetadata dataset. */ + public dataset: string; + + /** ExportDataOperationMetadata partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** ExportDataOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata): google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @param message ExportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @param message ExportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata; + + /** + * Verifies an ExportDataOperationMetadata message. + * @param message Plain 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 ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata; + + /** + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. + * @param message ExportDataOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelOperationMetadata. */ + interface ILabelOperationMetadata { + + /** LabelOperationMetadata imageClassificationDetails */ + imageClassificationDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata|null); + + /** LabelOperationMetadata imageBoundingBoxDetails */ + imageBoundingBoxDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata|null); + + /** LabelOperationMetadata imageBoundingPolyDetails */ + imageBoundingPolyDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata|null); + + /** LabelOperationMetadata imageOrientedBoundingBoxDetails */ + imageOrientedBoundingBoxDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata|null); + + /** LabelOperationMetadata imagePolylineDetails */ + imagePolylineDetails?: (google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata|null); + + /** LabelOperationMetadata imageSegmentationDetails */ + imageSegmentationDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata|null); + + /** LabelOperationMetadata videoClassificationDetails */ + videoClassificationDetails?: (google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata|null); + + /** LabelOperationMetadata videoObjectDetectionDetails */ + videoObjectDetectionDetails?: (google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata|null); + + /** LabelOperationMetadata videoObjectTrackingDetails */ + videoObjectTrackingDetails?: (google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata|null); + + /** LabelOperationMetadata videoEventDetails */ + videoEventDetails?: (google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata|null); + + /** LabelOperationMetadata textClassificationDetails */ + textClassificationDetails?: (google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata|null); + + /** LabelOperationMetadata textEntityExtractionDetails */ + textEntityExtractionDetails?: (google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata|null); + + /** LabelOperationMetadata progressPercent */ + progressPercent?: (number|null); + + /** LabelOperationMetadata partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + + /** LabelOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a LabelOperationMetadata. */ + class LabelOperationMetadata implements ILabelOperationMetadata { + + /** + * Constructs a new LabelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelOperationMetadata); + + /** LabelOperationMetadata imageClassificationDetails. */ + public imageClassificationDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata|null); + + /** LabelOperationMetadata imageBoundingBoxDetails. */ + public imageBoundingBoxDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata|null); + + /** LabelOperationMetadata imageBoundingPolyDetails. */ + public imageBoundingPolyDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata|null); + + /** LabelOperationMetadata imageOrientedBoundingBoxDetails. */ + public imageOrientedBoundingBoxDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata|null); + + /** LabelOperationMetadata imagePolylineDetails. */ + public imagePolylineDetails?: (google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata|null); + + /** LabelOperationMetadata imageSegmentationDetails. */ + public imageSegmentationDetails?: (google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata|null); + + /** LabelOperationMetadata videoClassificationDetails. */ + public videoClassificationDetails?: (google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata|null); + + /** LabelOperationMetadata videoObjectDetectionDetails. */ + public videoObjectDetectionDetails?: (google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata|null); + + /** LabelOperationMetadata videoObjectTrackingDetails. */ + public videoObjectTrackingDetails?: (google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata|null); + + /** LabelOperationMetadata videoEventDetails. */ + public videoEventDetails?: (google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata|null); + + /** LabelOperationMetadata textClassificationDetails. */ + public textClassificationDetails?: (google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata|null); + + /** LabelOperationMetadata textEntityExtractionDetails. */ + public textEntityExtractionDetails?: (google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata|null); + + /** LabelOperationMetadata progressPercent. */ + public progressPercent: number; + + /** LabelOperationMetadata partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** LabelOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** LabelOperationMetadata details. */ + public details?: ("imageClassificationDetails"|"imageBoundingBoxDetails"|"imageBoundingPolyDetails"|"imageOrientedBoundingBoxDetails"|"imagePolylineDetails"|"imageSegmentationDetails"|"videoClassificationDetails"|"videoObjectDetectionDetails"|"videoObjectTrackingDetails"|"videoEventDetails"|"textClassificationDetails"|"textEntityExtractionDetails"); + + /** + * Creates a new LabelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelOperationMetadata): google.cloud.datalabeling.v1beta1.LabelOperationMetadata; + + /** + * Encodes the specified LabelOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelOperationMetadata.verify|verify} messages. + * @param message LabelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelOperationMetadata.verify|verify} messages. + * @param message LabelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelOperationMetadata; + + /** + * Decodes a LabelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelOperationMetadata; + + /** + * Verifies a LabelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelOperationMetadata; + + /** + * Creates a plain object from a LabelOperationMetadata message. Also converts values to other types if specified. + * @param message LabelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelImageClassificationOperationMetadata. */ + interface ILabelImageClassificationOperationMetadata { + + /** LabelImageClassificationOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelImageClassificationOperationMetadata. */ + class LabelImageClassificationOperationMetadata implements ILabelImageClassificationOperationMetadata { + + /** + * Constructs a new LabelImageClassificationOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata); + + /** LabelImageClassificationOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelImageClassificationOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelImageClassificationOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata): google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata; + + /** + * Encodes the specified LabelImageClassificationOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.verify|verify} messages. + * @param message LabelImageClassificationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelImageClassificationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.verify|verify} messages. + * @param message LabelImageClassificationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelImageClassificationOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelImageClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata; + + /** + * Decodes a LabelImageClassificationOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelImageClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata; + + /** + * Verifies a LabelImageClassificationOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelImageClassificationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelImageClassificationOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata; + + /** + * Creates a plain object from a LabelImageClassificationOperationMetadata message. Also converts values to other types if specified. + * @param message LabelImageClassificationOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelImageClassificationOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelImageClassificationOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelImageBoundingBoxOperationMetadata. */ + interface ILabelImageBoundingBoxOperationMetadata { + + /** LabelImageBoundingBoxOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelImageBoundingBoxOperationMetadata. */ + class LabelImageBoundingBoxOperationMetadata implements ILabelImageBoundingBoxOperationMetadata { + + /** + * Constructs a new LabelImageBoundingBoxOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata); + + /** LabelImageBoundingBoxOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelImageBoundingBoxOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelImageBoundingBoxOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata): google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata; + + /** + * Encodes the specified LabelImageBoundingBoxOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.verify|verify} messages. + * @param message LabelImageBoundingBoxOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelImageBoundingBoxOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.verify|verify} messages. + * @param message LabelImageBoundingBoxOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelImageBoundingBoxOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelImageBoundingBoxOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata; + + /** + * Decodes a LabelImageBoundingBoxOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelImageBoundingBoxOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata; + + /** + * Verifies a LabelImageBoundingBoxOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelImageBoundingBoxOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelImageBoundingBoxOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata; + + /** + * Creates a plain object from a LabelImageBoundingBoxOperationMetadata message. Also converts values to other types if specified. + * @param message LabelImageBoundingBoxOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelImageBoundingBoxOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelImageBoundingBoxOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelImageOrientedBoundingBoxOperationMetadata. */ + interface ILabelImageOrientedBoundingBoxOperationMetadata { + + /** LabelImageOrientedBoundingBoxOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelImageOrientedBoundingBoxOperationMetadata. */ + class LabelImageOrientedBoundingBoxOperationMetadata implements ILabelImageOrientedBoundingBoxOperationMetadata { + + /** + * Constructs a new LabelImageOrientedBoundingBoxOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata); + + /** LabelImageOrientedBoundingBoxOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelImageOrientedBoundingBoxOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelImageOrientedBoundingBoxOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata): google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata; + + /** + * Encodes the specified LabelImageOrientedBoundingBoxOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.verify|verify} messages. + * @param message LabelImageOrientedBoundingBoxOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelImageOrientedBoundingBoxOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.verify|verify} messages. + * @param message LabelImageOrientedBoundingBoxOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelImageOrientedBoundingBoxOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelImageOrientedBoundingBoxOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata; + + /** + * Decodes a LabelImageOrientedBoundingBoxOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelImageOrientedBoundingBoxOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata; + + /** + * Verifies a LabelImageOrientedBoundingBoxOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelImageOrientedBoundingBoxOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelImageOrientedBoundingBoxOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata; + + /** + * Creates a plain object from a LabelImageOrientedBoundingBoxOperationMetadata message. Also converts values to other types if specified. + * @param message LabelImageOrientedBoundingBoxOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelImageOrientedBoundingBoxOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelImageOrientedBoundingBoxOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelImageBoundingPolyOperationMetadata. */ + interface ILabelImageBoundingPolyOperationMetadata { + + /** LabelImageBoundingPolyOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelImageBoundingPolyOperationMetadata. */ + class LabelImageBoundingPolyOperationMetadata implements ILabelImageBoundingPolyOperationMetadata { + + /** + * Constructs a new LabelImageBoundingPolyOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata); + + /** LabelImageBoundingPolyOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelImageBoundingPolyOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelImageBoundingPolyOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata): google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata; + + /** + * Encodes the specified LabelImageBoundingPolyOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.verify|verify} messages. + * @param message LabelImageBoundingPolyOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelImageBoundingPolyOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.verify|verify} messages. + * @param message LabelImageBoundingPolyOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelImageBoundingPolyOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelImageBoundingPolyOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata; + + /** + * Decodes a LabelImageBoundingPolyOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelImageBoundingPolyOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata; + + /** + * Verifies a LabelImageBoundingPolyOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelImageBoundingPolyOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelImageBoundingPolyOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata; + + /** + * Creates a plain object from a LabelImageBoundingPolyOperationMetadata message. Also converts values to other types if specified. + * @param message LabelImageBoundingPolyOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelImageBoundingPolyOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelImageBoundingPolyOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelImagePolylineOperationMetadata. */ + interface ILabelImagePolylineOperationMetadata { + + /** LabelImagePolylineOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelImagePolylineOperationMetadata. */ + class LabelImagePolylineOperationMetadata implements ILabelImagePolylineOperationMetadata { + + /** + * Constructs a new LabelImagePolylineOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata); + + /** LabelImagePolylineOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelImagePolylineOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelImagePolylineOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata): google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata; + + /** + * Encodes the specified LabelImagePolylineOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.verify|verify} messages. + * @param message LabelImagePolylineOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelImagePolylineOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.verify|verify} messages. + * @param message LabelImagePolylineOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelImagePolylineOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelImagePolylineOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata; + + /** + * Decodes a LabelImagePolylineOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelImagePolylineOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata; + + /** + * Verifies a LabelImagePolylineOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelImagePolylineOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelImagePolylineOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata; + + /** + * Creates a plain object from a LabelImagePolylineOperationMetadata message. Also converts values to other types if specified. + * @param message LabelImagePolylineOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelImagePolylineOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelImagePolylineOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelImageSegmentationOperationMetadata. */ + interface ILabelImageSegmentationOperationMetadata { + + /** LabelImageSegmentationOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelImageSegmentationOperationMetadata. */ + class LabelImageSegmentationOperationMetadata implements ILabelImageSegmentationOperationMetadata { + + /** + * Constructs a new LabelImageSegmentationOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata); + + /** LabelImageSegmentationOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelImageSegmentationOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelImageSegmentationOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata): google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata; + + /** + * Encodes the specified LabelImageSegmentationOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.verify|verify} messages. + * @param message LabelImageSegmentationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelImageSegmentationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.verify|verify} messages. + * @param message LabelImageSegmentationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelImageSegmentationOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelImageSegmentationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata; + + /** + * Decodes a LabelImageSegmentationOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelImageSegmentationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata; + + /** + * Verifies a LabelImageSegmentationOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelImageSegmentationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelImageSegmentationOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata; + + /** + * Creates a plain object from a LabelImageSegmentationOperationMetadata message. Also converts values to other types if specified. + * @param message LabelImageSegmentationOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelImageSegmentationOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelImageSegmentationOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelVideoClassificationOperationMetadata. */ + interface ILabelVideoClassificationOperationMetadata { + + /** LabelVideoClassificationOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelVideoClassificationOperationMetadata. */ + class LabelVideoClassificationOperationMetadata implements ILabelVideoClassificationOperationMetadata { + + /** + * Constructs a new LabelVideoClassificationOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata); + + /** LabelVideoClassificationOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelVideoClassificationOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelVideoClassificationOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata): google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata; + + /** + * Encodes the specified LabelVideoClassificationOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.verify|verify} messages. + * @param message LabelVideoClassificationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelVideoClassificationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.verify|verify} messages. + * @param message LabelVideoClassificationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelVideoClassificationOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelVideoClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata; + + /** + * Decodes a LabelVideoClassificationOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelVideoClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata; + + /** + * Verifies a LabelVideoClassificationOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelVideoClassificationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelVideoClassificationOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata; + + /** + * Creates a plain object from a LabelVideoClassificationOperationMetadata message. Also converts values to other types if specified. + * @param message LabelVideoClassificationOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelVideoClassificationOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelVideoClassificationOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelVideoObjectDetectionOperationMetadata. */ + interface ILabelVideoObjectDetectionOperationMetadata { + + /** LabelVideoObjectDetectionOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelVideoObjectDetectionOperationMetadata. */ + class LabelVideoObjectDetectionOperationMetadata implements ILabelVideoObjectDetectionOperationMetadata { + + /** + * Constructs a new LabelVideoObjectDetectionOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata); + + /** LabelVideoObjectDetectionOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelVideoObjectDetectionOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelVideoObjectDetectionOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata): google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata; + + /** + * Encodes the specified LabelVideoObjectDetectionOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.verify|verify} messages. + * @param message LabelVideoObjectDetectionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelVideoObjectDetectionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.verify|verify} messages. + * @param message LabelVideoObjectDetectionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelVideoObjectDetectionOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelVideoObjectDetectionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata; + + /** + * Decodes a LabelVideoObjectDetectionOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelVideoObjectDetectionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata; + + /** + * Verifies a LabelVideoObjectDetectionOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelVideoObjectDetectionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelVideoObjectDetectionOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata; + + /** + * Creates a plain object from a LabelVideoObjectDetectionOperationMetadata message. Also converts values to other types if specified. + * @param message LabelVideoObjectDetectionOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelVideoObjectDetectionOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelVideoObjectDetectionOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelVideoObjectTrackingOperationMetadata. */ + interface ILabelVideoObjectTrackingOperationMetadata { + + /** LabelVideoObjectTrackingOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelVideoObjectTrackingOperationMetadata. */ + class LabelVideoObjectTrackingOperationMetadata implements ILabelVideoObjectTrackingOperationMetadata { + + /** + * Constructs a new LabelVideoObjectTrackingOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata); + + /** LabelVideoObjectTrackingOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelVideoObjectTrackingOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelVideoObjectTrackingOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata): google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata; + + /** + * Encodes the specified LabelVideoObjectTrackingOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.verify|verify} messages. + * @param message LabelVideoObjectTrackingOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelVideoObjectTrackingOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.verify|verify} messages. + * @param message LabelVideoObjectTrackingOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelVideoObjectTrackingOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelVideoObjectTrackingOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata; + + /** + * Decodes a LabelVideoObjectTrackingOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelVideoObjectTrackingOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata; + + /** + * Verifies a LabelVideoObjectTrackingOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelVideoObjectTrackingOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelVideoObjectTrackingOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata; + + /** + * Creates a plain object from a LabelVideoObjectTrackingOperationMetadata message. Also converts values to other types if specified. + * @param message LabelVideoObjectTrackingOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelVideoObjectTrackingOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelVideoObjectTrackingOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelVideoEventOperationMetadata. */ + interface ILabelVideoEventOperationMetadata { + + /** LabelVideoEventOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelVideoEventOperationMetadata. */ + class LabelVideoEventOperationMetadata implements ILabelVideoEventOperationMetadata { + + /** + * Constructs a new LabelVideoEventOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata); + + /** LabelVideoEventOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelVideoEventOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelVideoEventOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata): google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata; + + /** + * Encodes the specified LabelVideoEventOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.verify|verify} messages. + * @param message LabelVideoEventOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelVideoEventOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.verify|verify} messages. + * @param message LabelVideoEventOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelVideoEventOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelVideoEventOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata; + + /** + * Decodes a LabelVideoEventOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelVideoEventOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata; + + /** + * Verifies a LabelVideoEventOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelVideoEventOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelVideoEventOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata; + + /** + * Creates a plain object from a LabelVideoEventOperationMetadata message. Also converts values to other types if specified. + * @param message LabelVideoEventOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelVideoEventOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelVideoEventOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelTextClassificationOperationMetadata. */ + interface ILabelTextClassificationOperationMetadata { + + /** LabelTextClassificationOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelTextClassificationOperationMetadata. */ + class LabelTextClassificationOperationMetadata implements ILabelTextClassificationOperationMetadata { + + /** + * Constructs a new LabelTextClassificationOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata); + + /** LabelTextClassificationOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelTextClassificationOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelTextClassificationOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata): google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata; + + /** + * Encodes the specified LabelTextClassificationOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.verify|verify} messages. + * @param message LabelTextClassificationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelTextClassificationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.verify|verify} messages. + * @param message LabelTextClassificationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelTextClassificationOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelTextClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata; + + /** + * Decodes a LabelTextClassificationOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelTextClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata; + + /** + * Verifies a LabelTextClassificationOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelTextClassificationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelTextClassificationOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata; + + /** + * Creates a plain object from a LabelTextClassificationOperationMetadata message. Also converts values to other types if specified. + * @param message LabelTextClassificationOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelTextClassificationOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelTextClassificationOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelTextEntityExtractionOperationMetadata. */ + interface ILabelTextEntityExtractionOperationMetadata { + + /** LabelTextEntityExtractionOperationMetadata basicConfig */ + basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + } + + /** Represents a LabelTextEntityExtractionOperationMetadata. */ + class LabelTextEntityExtractionOperationMetadata implements ILabelTextEntityExtractionOperationMetadata { + + /** + * Constructs a new LabelTextEntityExtractionOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata); + + /** LabelTextEntityExtractionOperationMetadata basicConfig. */ + public basicConfig?: (google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null); + + /** + * Creates a new LabelTextEntityExtractionOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelTextEntityExtractionOperationMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata): google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata; + + /** + * Encodes the specified LabelTextEntityExtractionOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.verify|verify} messages. + * @param message LabelTextEntityExtractionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelTextEntityExtractionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.verify|verify} messages. + * @param message LabelTextEntityExtractionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelTextEntityExtractionOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelTextEntityExtractionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata; + + /** + * Decodes a LabelTextEntityExtractionOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelTextEntityExtractionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata; + + /** + * Verifies a LabelTextEntityExtractionOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelTextEntityExtractionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelTextEntityExtractionOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata; + + /** + * Creates a plain object from a LabelTextEntityExtractionOperationMetadata message. Also converts values to other types if specified. + * @param message LabelTextEntityExtractionOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelTextEntityExtractionOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelTextEntityExtractionOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstructionMetadata. */ + interface ICreateInstructionMetadata { + + /** CreateInstructionMetadata instruction */ + instruction?: (string|null); + + /** CreateInstructionMetadata partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + + /** CreateInstructionMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateInstructionMetadata. */ + class CreateInstructionMetadata implements ICreateInstructionMetadata { + + /** + * Constructs a new CreateInstructionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata); + + /** CreateInstructionMetadata instruction. */ + public instruction: string; + + /** CreateInstructionMetadata partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** CreateInstructionMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateInstructionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstructionMetadata instance + */ + public static create(properties?: google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata): google.cloud.datalabeling.v1beta1.CreateInstructionMetadata; + + /** + * Encodes the specified CreateInstructionMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.verify|verify} messages. + * @param message CreateInstructionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstructionMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.verify|verify} messages. + * @param message CreateInstructionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstructionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstructionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datalabeling.v1beta1.CreateInstructionMetadata; + + /** + * Decodes a CreateInstructionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstructionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datalabeling.v1beta1.CreateInstructionMetadata; + + /** + * Verifies a CreateInstructionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstructionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstructionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datalabeling.v1beta1.CreateInstructionMetadata; + + /** + * Creates a plain object from a CreateInstructionMetadata message. Also converts values to other types if specified. + * @param message CreateInstructionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datalabeling.v1beta1.CreateInstructionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstructionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstructionMetadata + * @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 ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-datalabeling/protos/protos.js b/packages/google-cloud-datalabeling/protos/protos.js new file mode 100644 index 00000000000..2bd1ab2650a --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/protos.js @@ -0,0 +1,51999 @@ +// 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_datalabeling_protos || ($protobuf.roots._google_cloud_datalabeling_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.datalabeling = (function() { + + /** + * Namespace datalabeling. + * @memberof google.cloud + * @namespace + */ + var datalabeling = {}; + + datalabeling.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.datalabeling + * @namespace + */ + var v1beta1 = {}; + + /** + * AnnotationSource enum. + * @name google.cloud.datalabeling.v1beta1.AnnotationSource + * @enum {number} + * @property {number} ANNOTATION_SOURCE_UNSPECIFIED=0 ANNOTATION_SOURCE_UNSPECIFIED value + * @property {number} OPERATOR=3 OPERATOR value + */ + v1beta1.AnnotationSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANNOTATION_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[3] = "OPERATOR"] = 3; + return values; + })(); + + v1beta1.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IAnnotation + * @property {string|null} [name] Annotation name + * @property {google.cloud.datalabeling.v1beta1.AnnotationSource|null} [annotationSource] Annotation annotationSource + * @property {google.cloud.datalabeling.v1beta1.IAnnotationValue|null} [annotationValue] Annotation annotationValue + * @property {google.cloud.datalabeling.v1beta1.IAnnotationMetadata|null} [annotationMetadata] Annotation annotationMetadata + * @property {google.cloud.datalabeling.v1beta1.AnnotationSentiment|null} [annotationSentiment] Annotation annotationSentiment + */ + + /** + * Constructs a new Annotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + if (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 name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.Annotation + * @instance + */ + Annotation.prototype.name = ""; + + /** + * Annotation annotationSource. + * @member {google.cloud.datalabeling.v1beta1.AnnotationSource} annotationSource + * @memberof google.cloud.datalabeling.v1beta1.Annotation + * @instance + */ + Annotation.prototype.annotationSource = 0; + + /** + * Annotation annotationValue. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationValue|null|undefined} annotationValue + * @memberof google.cloud.datalabeling.v1beta1.Annotation + * @instance + */ + Annotation.prototype.annotationValue = null; + + /** + * Annotation annotationMetadata. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationMetadata|null|undefined} annotationMetadata + * @memberof google.cloud.datalabeling.v1beta1.Annotation + * @instance + */ + Annotation.prototype.annotationMetadata = null; + + /** + * Annotation annotationSentiment. + * @member {google.cloud.datalabeling.v1beta1.AnnotationSentiment} annotationSentiment + * @memberof google.cloud.datalabeling.v1beta1.Annotation + * @instance + */ + Annotation.prototype.annotationSentiment = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.Annotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Annotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.Annotation + * @static + * @param {google.cloud.datalabeling.v1beta1.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.annotationSource != null && Object.hasOwnProperty.call(message, "annotationSource")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotationSource); + if (message.annotationValue != null && Object.hasOwnProperty.call(message, "annotationValue")) + $root.google.cloud.datalabeling.v1beta1.AnnotationValue.encode(message.annotationValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.annotationMetadata != null && Object.hasOwnProperty.call(message, "annotationMetadata")) + $root.google.cloud.datalabeling.v1beta1.AnnotationMetadata.encode(message.annotationMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.annotationSentiment != null && Object.hasOwnProperty.call(message, "annotationSentiment")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.annotationSentiment); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Annotation + * @static + * @param {google.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.annotationSource = reader.int32(); + break; + } + case 3: { + message.annotationValue = $root.google.cloud.datalabeling.v1beta1.AnnotationValue.decode(reader, reader.uint32()); + break; + } + case 4: { + message.annotationMetadata = $root.google.cloud.datalabeling.v1beta1.AnnotationMetadata.decode(reader, reader.uint32()); + break; + } + case 6: { + message.annotationSentiment = 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.cloud.datalabeling.v1beta1.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.annotationSource != null && message.hasOwnProperty("annotationSource")) + switch (message.annotationSource) { + default: + return "annotationSource: enum value expected"; + case 0: + case 3: + break; + } + if (message.annotationValue != null && message.hasOwnProperty("annotationValue")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationValue.verify(message.annotationValue); + if (error) + return "annotationValue." + error; + } + if (message.annotationMetadata != null && message.hasOwnProperty("annotationMetadata")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationMetadata.verify(message.annotationMetadata); + if (error) + return "annotationMetadata." + error; + } + if (message.annotationSentiment != null && message.hasOwnProperty("annotationSentiment")) + switch (message.annotationSentiment) { + default: + return "annotationSentiment: 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.cloud.datalabeling.v1beta1.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.Annotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.Annotation(); + if (object.name != null) + message.name = String(object.name); + switch (object.annotationSource) { + default: + if (typeof object.annotationSource === "number") { + message.annotationSource = object.annotationSource; + break; + } + break; + case "ANNOTATION_SOURCE_UNSPECIFIED": + case 0: + message.annotationSource = 0; + break; + case "OPERATOR": + case 3: + message.annotationSource = 3; + break; + } + if (object.annotationValue != null) { + if (typeof object.annotationValue !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Annotation.annotationValue: object expected"); + message.annotationValue = $root.google.cloud.datalabeling.v1beta1.AnnotationValue.fromObject(object.annotationValue); + } + if (object.annotationMetadata != null) { + if (typeof object.annotationMetadata !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Annotation.annotationMetadata: object expected"); + message.annotationMetadata = $root.google.cloud.datalabeling.v1beta1.AnnotationMetadata.fromObject(object.annotationMetadata); + } + switch (object.annotationSentiment) { + default: + if (typeof object.annotationSentiment === "number") { + message.annotationSentiment = object.annotationSentiment; + break; + } + break; + case "ANNOTATION_SENTIMENT_UNSPECIFIED": + case 0: + message.annotationSentiment = 0; + break; + case "NEGATIVE": + case 1: + message.annotationSentiment = 1; + break; + case "POSITIVE": + case 2: + message.annotationSentiment = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.Annotation + * @static + * @param {google.cloud.datalabeling.v1beta1.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.defaults) { + object.name = ""; + object.annotationSource = options.enums === String ? "ANNOTATION_SOURCE_UNSPECIFIED" : 0; + object.annotationValue = null; + object.annotationMetadata = null; + object.annotationSentiment = options.enums === String ? "ANNOTATION_SENTIMENT_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.annotationSource != null && message.hasOwnProperty("annotationSource")) + object.annotationSource = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.AnnotationSource[message.annotationSource] === undefined ? message.annotationSource : $root.google.cloud.datalabeling.v1beta1.AnnotationSource[message.annotationSource] : message.annotationSource; + if (message.annotationValue != null && message.hasOwnProperty("annotationValue")) + object.annotationValue = $root.google.cloud.datalabeling.v1beta1.AnnotationValue.toObject(message.annotationValue, options); + if (message.annotationMetadata != null && message.hasOwnProperty("annotationMetadata")) + object.annotationMetadata = $root.google.cloud.datalabeling.v1beta1.AnnotationMetadata.toObject(message.annotationMetadata, options); + if (message.annotationSentiment != null && message.hasOwnProperty("annotationSentiment")) + object.annotationSentiment = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.AnnotationSentiment[message.annotationSentiment] === undefined ? message.annotationSentiment : $root.google.cloud.datalabeling.v1beta1.AnnotationSentiment[message.annotationSentiment] : message.annotationSentiment; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.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.cloud.datalabeling.v1beta1.Annotation"; + }; + + return Annotation; + })(); + + /** + * AnnotationSentiment enum. + * @name google.cloud.datalabeling.v1beta1.AnnotationSentiment + * @enum {number} + * @property {number} ANNOTATION_SENTIMENT_UNSPECIFIED=0 ANNOTATION_SENTIMENT_UNSPECIFIED value + * @property {number} NEGATIVE=1 NEGATIVE value + * @property {number} POSITIVE=2 POSITIVE value + */ + v1beta1.AnnotationSentiment = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANNOTATION_SENTIMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEGATIVE"] = 1; + values[valuesById[2] = "POSITIVE"] = 2; + return values; + })(); + + /** + * AnnotationType enum. + * @name google.cloud.datalabeling.v1beta1.AnnotationType + * @enum {number} + * @property {number} ANNOTATION_TYPE_UNSPECIFIED=0 ANNOTATION_TYPE_UNSPECIFIED value + * @property {number} IMAGE_CLASSIFICATION_ANNOTATION=1 IMAGE_CLASSIFICATION_ANNOTATION value + * @property {number} IMAGE_BOUNDING_BOX_ANNOTATION=2 IMAGE_BOUNDING_BOX_ANNOTATION value + * @property {number} IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION=13 IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION value + * @property {number} IMAGE_BOUNDING_POLY_ANNOTATION=10 IMAGE_BOUNDING_POLY_ANNOTATION value + * @property {number} IMAGE_POLYLINE_ANNOTATION=11 IMAGE_POLYLINE_ANNOTATION value + * @property {number} IMAGE_SEGMENTATION_ANNOTATION=12 IMAGE_SEGMENTATION_ANNOTATION value + * @property {number} VIDEO_SHOTS_CLASSIFICATION_ANNOTATION=3 VIDEO_SHOTS_CLASSIFICATION_ANNOTATION value + * @property {number} VIDEO_OBJECT_TRACKING_ANNOTATION=4 VIDEO_OBJECT_TRACKING_ANNOTATION value + * @property {number} VIDEO_OBJECT_DETECTION_ANNOTATION=5 VIDEO_OBJECT_DETECTION_ANNOTATION value + * @property {number} VIDEO_EVENT_ANNOTATION=6 VIDEO_EVENT_ANNOTATION value + * @property {number} TEXT_CLASSIFICATION_ANNOTATION=8 TEXT_CLASSIFICATION_ANNOTATION value + * @property {number} TEXT_ENTITY_EXTRACTION_ANNOTATION=9 TEXT_ENTITY_EXTRACTION_ANNOTATION value + * @property {number} GENERAL_CLASSIFICATION_ANNOTATION=14 GENERAL_CLASSIFICATION_ANNOTATION value + */ + v1beta1.AnnotationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANNOTATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMAGE_CLASSIFICATION_ANNOTATION"] = 1; + values[valuesById[2] = "IMAGE_BOUNDING_BOX_ANNOTATION"] = 2; + values[valuesById[13] = "IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION"] = 13; + values[valuesById[10] = "IMAGE_BOUNDING_POLY_ANNOTATION"] = 10; + values[valuesById[11] = "IMAGE_POLYLINE_ANNOTATION"] = 11; + values[valuesById[12] = "IMAGE_SEGMENTATION_ANNOTATION"] = 12; + values[valuesById[3] = "VIDEO_SHOTS_CLASSIFICATION_ANNOTATION"] = 3; + values[valuesById[4] = "VIDEO_OBJECT_TRACKING_ANNOTATION"] = 4; + values[valuesById[5] = "VIDEO_OBJECT_DETECTION_ANNOTATION"] = 5; + values[valuesById[6] = "VIDEO_EVENT_ANNOTATION"] = 6; + values[valuesById[8] = "TEXT_CLASSIFICATION_ANNOTATION"] = 8; + values[valuesById[9] = "TEXT_ENTITY_EXTRACTION_ANNOTATION"] = 9; + values[valuesById[14] = "GENERAL_CLASSIFICATION_ANNOTATION"] = 14; + return values; + })(); + + v1beta1.AnnotationValue = (function() { + + /** + * Properties of an AnnotationValue. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IAnnotationValue + * @property {google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation|null} [imageClassificationAnnotation] AnnotationValue imageClassificationAnnotation + * @property {google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation|null} [imageBoundingPolyAnnotation] AnnotationValue imageBoundingPolyAnnotation + * @property {google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation|null} [imagePolylineAnnotation] AnnotationValue imagePolylineAnnotation + * @property {google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation|null} [imageSegmentationAnnotation] AnnotationValue imageSegmentationAnnotation + * @property {google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation|null} [textClassificationAnnotation] AnnotationValue textClassificationAnnotation + * @property {google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation|null} [textEntityExtractionAnnotation] AnnotationValue textEntityExtractionAnnotation + * @property {google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation|null} [videoClassificationAnnotation] AnnotationValue videoClassificationAnnotation + * @property {google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation|null} [videoObjectTrackingAnnotation] AnnotationValue videoObjectTrackingAnnotation + * @property {google.cloud.datalabeling.v1beta1.IVideoEventAnnotation|null} [videoEventAnnotation] AnnotationValue videoEventAnnotation + */ + + /** + * Constructs a new AnnotationValue. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an AnnotationValue. + * @implements IAnnotationValue + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IAnnotationValue=} [properties] Properties to set + */ + function AnnotationValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationValue imageClassificationAnnotation. + * @member {google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation|null|undefined} imageClassificationAnnotation + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.imageClassificationAnnotation = null; + + /** + * AnnotationValue imageBoundingPolyAnnotation. + * @member {google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation|null|undefined} imageBoundingPolyAnnotation + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.imageBoundingPolyAnnotation = null; + + /** + * AnnotationValue imagePolylineAnnotation. + * @member {google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation|null|undefined} imagePolylineAnnotation + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.imagePolylineAnnotation = null; + + /** + * AnnotationValue imageSegmentationAnnotation. + * @member {google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation|null|undefined} imageSegmentationAnnotation + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.imageSegmentationAnnotation = null; + + /** + * AnnotationValue textClassificationAnnotation. + * @member {google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation|null|undefined} textClassificationAnnotation + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.textClassificationAnnotation = null; + + /** + * AnnotationValue textEntityExtractionAnnotation. + * @member {google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation|null|undefined} textEntityExtractionAnnotation + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.textEntityExtractionAnnotation = null; + + /** + * AnnotationValue videoClassificationAnnotation. + * @member {google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation|null|undefined} videoClassificationAnnotation + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.videoClassificationAnnotation = null; + + /** + * AnnotationValue videoObjectTrackingAnnotation. + * @member {google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation|null|undefined} videoObjectTrackingAnnotation + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.videoObjectTrackingAnnotation = null; + + /** + * AnnotationValue videoEventAnnotation. + * @member {google.cloud.datalabeling.v1beta1.IVideoEventAnnotation|null|undefined} videoEventAnnotation + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.videoEventAnnotation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnnotationValue valueType. + * @member {"imageClassificationAnnotation"|"imageBoundingPolyAnnotation"|"imagePolylineAnnotation"|"imageSegmentationAnnotation"|"textClassificationAnnotation"|"textEntityExtractionAnnotation"|"videoClassificationAnnotation"|"videoObjectTrackingAnnotation"|"videoEventAnnotation"|undefined} valueType + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + */ + Object.defineProperty(AnnotationValue.prototype, "valueType", { + get: $util.oneOfGetter($oneOfFields = ["imageClassificationAnnotation", "imageBoundingPolyAnnotation", "imagePolylineAnnotation", "imageSegmentationAnnotation", "textClassificationAnnotation", "textEntityExtractionAnnotation", "videoClassificationAnnotation", "videoObjectTrackingAnnotation", "videoEventAnnotation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnnotationValue instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationValue=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.AnnotationValue} AnnotationValue instance + */ + AnnotationValue.create = function create(properties) { + return new AnnotationValue(properties); + }; + + /** + * Encodes the specified AnnotationValue message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationValue} message AnnotationValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageClassificationAnnotation != null && Object.hasOwnProperty.call(message, "imageClassificationAnnotation")) + $root.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.encode(message.imageClassificationAnnotation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.imageBoundingPolyAnnotation != null && Object.hasOwnProperty.call(message, "imageBoundingPolyAnnotation")) + $root.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.encode(message.imageBoundingPolyAnnotation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.textClassificationAnnotation != null && Object.hasOwnProperty.call(message, "textClassificationAnnotation")) + $root.google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.encode(message.textClassificationAnnotation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.videoClassificationAnnotation != null && Object.hasOwnProperty.call(message, "videoClassificationAnnotation")) + $root.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.encode(message.videoClassificationAnnotation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.videoObjectTrackingAnnotation != null && Object.hasOwnProperty.call(message, "videoObjectTrackingAnnotation")) + $root.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.encode(message.videoObjectTrackingAnnotation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.videoEventAnnotation != null && Object.hasOwnProperty.call(message, "videoEventAnnotation")) + $root.google.cloud.datalabeling.v1beta1.VideoEventAnnotation.encode(message.videoEventAnnotation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.imagePolylineAnnotation != null && Object.hasOwnProperty.call(message, "imagePolylineAnnotation")) + $root.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.encode(message.imagePolylineAnnotation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.imageSegmentationAnnotation != null && Object.hasOwnProperty.call(message, "imageSegmentationAnnotation")) + $root.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.encode(message.imageSegmentationAnnotation, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.textEntityExtractionAnnotation != null && Object.hasOwnProperty.call(message, "textEntityExtractionAnnotation")) + $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.encode(message.textEntityExtractionAnnotation, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotationValue message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationValue} message AnnotationValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.AnnotationValue} AnnotationValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.AnnotationValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageClassificationAnnotation = $root.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.imageBoundingPolyAnnotation = $root.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.decode(reader, reader.uint32()); + break; + } + case 8: { + message.imagePolylineAnnotation = $root.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.decode(reader, reader.uint32()); + break; + } + case 9: { + message.imageSegmentationAnnotation = $root.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.textClassificationAnnotation = $root.google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 10: { + message.textEntityExtractionAnnotation = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.videoClassificationAnnotation = $root.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 5: { + message.videoObjectTrackingAnnotation = $root.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.videoEventAnnotation = $root.google.cloud.datalabeling.v1beta1.VideoEventAnnotation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.AnnotationValue} AnnotationValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationValue message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageClassificationAnnotation != null && message.hasOwnProperty("imageClassificationAnnotation")) { + properties.valueType = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.verify(message.imageClassificationAnnotation); + if (error) + return "imageClassificationAnnotation." + error; + } + } + if (message.imageBoundingPolyAnnotation != null && message.hasOwnProperty("imageBoundingPolyAnnotation")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.verify(message.imageBoundingPolyAnnotation); + if (error) + return "imageBoundingPolyAnnotation." + error; + } + } + if (message.imagePolylineAnnotation != null && message.hasOwnProperty("imagePolylineAnnotation")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.verify(message.imagePolylineAnnotation); + if (error) + return "imagePolylineAnnotation." + error; + } + } + if (message.imageSegmentationAnnotation != null && message.hasOwnProperty("imageSegmentationAnnotation")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.verify(message.imageSegmentationAnnotation); + if (error) + return "imageSegmentationAnnotation." + error; + } + } + if (message.textClassificationAnnotation != null && message.hasOwnProperty("textClassificationAnnotation")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.verify(message.textClassificationAnnotation); + if (error) + return "textClassificationAnnotation." + error; + } + } + if (message.textEntityExtractionAnnotation != null && message.hasOwnProperty("textEntityExtractionAnnotation")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.verify(message.textEntityExtractionAnnotation); + if (error) + return "textEntityExtractionAnnotation." + error; + } + } + if (message.videoClassificationAnnotation != null && message.hasOwnProperty("videoClassificationAnnotation")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.verify(message.videoClassificationAnnotation); + if (error) + return "videoClassificationAnnotation." + error; + } + } + if (message.videoObjectTrackingAnnotation != null && message.hasOwnProperty("videoObjectTrackingAnnotation")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.verify(message.videoObjectTrackingAnnotation); + if (error) + return "videoObjectTrackingAnnotation." + error; + } + } + if (message.videoEventAnnotation != null && message.hasOwnProperty("videoEventAnnotation")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.VideoEventAnnotation.verify(message.videoEventAnnotation); + if (error) + return "videoEventAnnotation." + error; + } + } + return null; + }; + + /** + * Creates an AnnotationValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.AnnotationValue} AnnotationValue + */ + AnnotationValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.AnnotationValue) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.AnnotationValue(); + if (object.imageClassificationAnnotation != null) { + if (typeof object.imageClassificationAnnotation !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationValue.imageClassificationAnnotation: object expected"); + message.imageClassificationAnnotation = $root.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.fromObject(object.imageClassificationAnnotation); + } + if (object.imageBoundingPolyAnnotation != null) { + if (typeof object.imageBoundingPolyAnnotation !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationValue.imageBoundingPolyAnnotation: object expected"); + message.imageBoundingPolyAnnotation = $root.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.fromObject(object.imageBoundingPolyAnnotation); + } + if (object.imagePolylineAnnotation != null) { + if (typeof object.imagePolylineAnnotation !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationValue.imagePolylineAnnotation: object expected"); + message.imagePolylineAnnotation = $root.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.fromObject(object.imagePolylineAnnotation); + } + if (object.imageSegmentationAnnotation != null) { + if (typeof object.imageSegmentationAnnotation !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationValue.imageSegmentationAnnotation: object expected"); + message.imageSegmentationAnnotation = $root.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.fromObject(object.imageSegmentationAnnotation); + } + if (object.textClassificationAnnotation != null) { + if (typeof object.textClassificationAnnotation !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationValue.textClassificationAnnotation: object expected"); + message.textClassificationAnnotation = $root.google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.fromObject(object.textClassificationAnnotation); + } + if (object.textEntityExtractionAnnotation != null) { + if (typeof object.textEntityExtractionAnnotation !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationValue.textEntityExtractionAnnotation: object expected"); + message.textEntityExtractionAnnotation = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.fromObject(object.textEntityExtractionAnnotation); + } + if (object.videoClassificationAnnotation != null) { + if (typeof object.videoClassificationAnnotation !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationValue.videoClassificationAnnotation: object expected"); + message.videoClassificationAnnotation = $root.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.fromObject(object.videoClassificationAnnotation); + } + if (object.videoObjectTrackingAnnotation != null) { + if (typeof object.videoObjectTrackingAnnotation !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationValue.videoObjectTrackingAnnotation: object expected"); + message.videoObjectTrackingAnnotation = $root.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.fromObject(object.videoObjectTrackingAnnotation); + } + if (object.videoEventAnnotation != null) { + if (typeof object.videoEventAnnotation !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationValue.videoEventAnnotation: object expected"); + message.videoEventAnnotation = $root.google.cloud.datalabeling.v1beta1.VideoEventAnnotation.fromObject(object.videoEventAnnotation); + } + return message; + }; + + /** + * Creates a plain object from an AnnotationValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @static + * @param {google.cloud.datalabeling.v1beta1.AnnotationValue} message AnnotationValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.imageClassificationAnnotation != null && message.hasOwnProperty("imageClassificationAnnotation")) { + object.imageClassificationAnnotation = $root.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.toObject(message.imageClassificationAnnotation, options); + if (options.oneofs) + object.valueType = "imageClassificationAnnotation"; + } + if (message.imageBoundingPolyAnnotation != null && message.hasOwnProperty("imageBoundingPolyAnnotation")) { + object.imageBoundingPolyAnnotation = $root.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.toObject(message.imageBoundingPolyAnnotation, options); + if (options.oneofs) + object.valueType = "imageBoundingPolyAnnotation"; + } + if (message.textClassificationAnnotation != null && message.hasOwnProperty("textClassificationAnnotation")) { + object.textClassificationAnnotation = $root.google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.toObject(message.textClassificationAnnotation, options); + if (options.oneofs) + object.valueType = "textClassificationAnnotation"; + } + if (message.videoClassificationAnnotation != null && message.hasOwnProperty("videoClassificationAnnotation")) { + object.videoClassificationAnnotation = $root.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.toObject(message.videoClassificationAnnotation, options); + if (options.oneofs) + object.valueType = "videoClassificationAnnotation"; + } + if (message.videoObjectTrackingAnnotation != null && message.hasOwnProperty("videoObjectTrackingAnnotation")) { + object.videoObjectTrackingAnnotation = $root.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.toObject(message.videoObjectTrackingAnnotation, options); + if (options.oneofs) + object.valueType = "videoObjectTrackingAnnotation"; + } + if (message.videoEventAnnotation != null && message.hasOwnProperty("videoEventAnnotation")) { + object.videoEventAnnotation = $root.google.cloud.datalabeling.v1beta1.VideoEventAnnotation.toObject(message.videoEventAnnotation, options); + if (options.oneofs) + object.valueType = "videoEventAnnotation"; + } + if (message.imagePolylineAnnotation != null && message.hasOwnProperty("imagePolylineAnnotation")) { + object.imagePolylineAnnotation = $root.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.toObject(message.imagePolylineAnnotation, options); + if (options.oneofs) + object.valueType = "imagePolylineAnnotation"; + } + if (message.imageSegmentationAnnotation != null && message.hasOwnProperty("imageSegmentationAnnotation")) { + object.imageSegmentationAnnotation = $root.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.toObject(message.imageSegmentationAnnotation, options); + if (options.oneofs) + object.valueType = "imageSegmentationAnnotation"; + } + if (message.textEntityExtractionAnnotation != null && message.hasOwnProperty("textEntityExtractionAnnotation")) { + object.textEntityExtractionAnnotation = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.toObject(message.textEntityExtractionAnnotation, options); + if (options.oneofs) + object.valueType = "textEntityExtractionAnnotation"; + } + return object; + }; + + /** + * Converts this AnnotationValue to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @instance + * @returns {Object.} JSON object + */ + AnnotationValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationValue + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.AnnotationValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.AnnotationValue"; + }; + + return AnnotationValue; + })(); + + v1beta1.ImageClassificationAnnotation = (function() { + + /** + * Properties of an ImageClassificationAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IImageClassificationAnnotation + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] ImageClassificationAnnotation annotationSpec + */ + + /** + * Constructs a new ImageClassificationAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ImageClassificationAnnotation. + * @implements IImageClassificationAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation=} [properties] Properties to set + */ + function ImageClassificationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationAnnotation annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @instance + */ + ImageClassificationAnnotation.prototype.annotationSpec = null; + + /** + * Creates a new ImageClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation} ImageClassificationAnnotation instance + */ + ImageClassificationAnnotation.create = function create(properties) { + return new ImageClassificationAnnotation(properties); + }; + + /** + * Encodes the specified ImageClassificationAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation} message ImageClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageClassificationAnnotation} message ImageClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation} ImageClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation} ImageClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationAnnotation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + return null; + }; + + /** + * Creates an ImageClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation} ImageClassificationAnnotation + */ + ImageClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation(); + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + return message; + }; + + /** + * Creates a plain object from an ImageClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation} message ImageClassificationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.annotationSpec = null; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + return object; + }; + + /** + * Converts this ImageClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationAnnotation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation"; + }; + + return ImageClassificationAnnotation; + })(); + + v1beta1.Vertex = (function() { + + /** + * Properties of a Vertex. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IVertex + * @property {number|null} [x] Vertex x + * @property {number|null} [y] Vertex y + */ + + /** + * Constructs a new Vertex. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a Vertex. + * @implements IVertex + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IVertex=} [properties] Properties to set + */ + function Vertex(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vertex x. + * @member {number} x + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @instance + */ + Vertex.prototype.x = 0; + + /** + * Vertex y. + * @member {number} y + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @instance + */ + Vertex.prototype.y = 0; + + /** + * Creates a new Vertex instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @static + * @param {google.cloud.datalabeling.v1beta1.IVertex=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.Vertex} Vertex instance + */ + Vertex.create = function create(properties) { + return new Vertex(properties); + }; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Vertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @static + * @param {google.cloud.datalabeling.v1beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.y); + return writer; + }; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Vertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @static + * @param {google.cloud.datalabeling.v1beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.Vertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.x = reader.int32(); + break; + } + case 2: { + message.y = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vertex message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (!$util.isInteger(message.x)) + return "x: integer expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (!$util.isInteger(message.y)) + return "y: integer expected"; + return null; + }; + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.Vertex} Vertex + */ + Vertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.Vertex) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.Vertex(); + if (object.x != null) + message.x = object.x | 0; + if (object.y != null) + message.y = object.y | 0; + return message; + }; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @static + * @param {google.cloud.datalabeling.v1beta1.Vertex} message Vertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vertex.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 = message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = message.y; + return object; + }; + + /** + * Converts this Vertex to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @instance + * @returns {Object.} JSON object + */ + Vertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Vertex + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.Vertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Vertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.Vertex"; + }; + + return Vertex; + })(); + + v1beta1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.datalabeling.v1beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.datalabeling.v1beta1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.NormalizedVertex) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1beta1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IBoundingPoly + * @property {Array.|null} [vertices] BoundingPoly vertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(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]]; + } + + /** + * BoundingPoly vertices. + * @member {Array.} vertices + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @static + * @param {google.cloud.datalabeling.v1beta1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @static + * @param {google.cloud.datalabeling.v1beta1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.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.datalabeling.v1beta1.Vertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @static + * @param {google.cloud.datalabeling.v1beta1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.BoundingPoly(); + 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.datalabeling.v1beta1.Vertex.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingPoly message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingPoly.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.datalabeling.v1beta1.Vertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + return null; + }; + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.BoundingPoly) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.BoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.datalabeling.v1beta1.BoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.BoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.datalabeling.v1beta1.Vertex.fromObject(object.vertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @static + * @param {google.cloud.datalabeling.v1beta1.BoundingPoly} message BoundingPoly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingPoly.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.datalabeling.v1beta1.Vertex.toObject(message.vertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingPoly + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.BoundingPoly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingPoly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.BoundingPoly"; + }; + + return BoundingPoly; + })(); + + v1beta1.NormalizedBoundingPoly = (function() { + + /** + * Properties of a NormalizedBoundingPoly. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface INormalizedBoundingPoly + * @property {Array.|null} [normalizedVertices] NormalizedBoundingPoly normalizedVertices + */ + + /** + * Constructs a new NormalizedBoundingPoly. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a NormalizedBoundingPoly. + * @implements INormalizedBoundingPoly + * @constructor + * @param {google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly=} [properties] Properties to set + */ + function NormalizedBoundingPoly(properties) { + this.normalizedVertices = []; + if (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 normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly + * @instance + */ + NormalizedBoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly} NormalizedBoundingPoly instance + */ + NormalizedBoundingPoly.create = function create(properties) { + return new NormalizedBoundingPoly(properties); + }; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.datalabeling.v1beta1.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.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.datalabeling.v1beta1.NormalizedVertex.encode(message.normalizedVertices[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.datalabeling.v1beta1.NormalizedBoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedBoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.normalizedVertices != null && message.hasOwnProperty("normalizedVertices")) { + if (!Array.isArray(message.normalizedVertices)) + return "normalizedVertices: array expected"; + for (var i = 0; i < message.normalizedVertices.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.NormalizedVertex.verify(message.normalizedVertices[i]); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a NormalizedBoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + */ + NormalizedBoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly(); + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.datalabeling.v1beta1.NormalizedVertex.fromObject(object.normalizedVertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.datalabeling.v1beta1.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.normalizedVertices = []; + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.datalabeling.v1beta1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this NormalizedBoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.NormalizedBoundingPoly"; + }; + + return NormalizedBoundingPoly; + })(); + + v1beta1.ImageBoundingPolyAnnotation = (function() { + + /** + * Properties of an ImageBoundingPolyAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IImageBoundingPolyAnnotation + * @property {google.cloud.datalabeling.v1beta1.IBoundingPoly|null} [boundingPoly] ImageBoundingPolyAnnotation boundingPoly + * @property {google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly|null} [normalizedBoundingPoly] ImageBoundingPolyAnnotation normalizedBoundingPoly + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] ImageBoundingPolyAnnotation annotationSpec + */ + + /** + * Constructs a new ImageBoundingPolyAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ImageBoundingPolyAnnotation. + * @implements IImageBoundingPolyAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation=} [properties] Properties to set + */ + function ImageBoundingPolyAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageBoundingPolyAnnotation boundingPoly. + * @member {google.cloud.datalabeling.v1beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @instance + */ + ImageBoundingPolyAnnotation.prototype.boundingPoly = null; + + /** + * ImageBoundingPolyAnnotation normalizedBoundingPoly. + * @member {google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly|null|undefined} normalizedBoundingPoly + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @instance + */ + ImageBoundingPolyAnnotation.prototype.normalizedBoundingPoly = null; + + /** + * ImageBoundingPolyAnnotation annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @instance + */ + ImageBoundingPolyAnnotation.prototype.annotationSpec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImageBoundingPolyAnnotation boundedArea. + * @member {"boundingPoly"|"normalizedBoundingPoly"|undefined} boundedArea + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @instance + */ + Object.defineProperty(ImageBoundingPolyAnnotation.prototype, "boundedArea", { + get: $util.oneOfGetter($oneOfFields = ["boundingPoly", "normalizedBoundingPoly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImageBoundingPolyAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation} ImageBoundingPolyAnnotation instance + */ + ImageBoundingPolyAnnotation.create = function create(properties) { + return new ImageBoundingPolyAnnotation(properties); + }; + + /** + * Encodes the specified ImageBoundingPolyAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation} message ImageBoundingPolyAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageBoundingPolyAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) + $root.google.cloud.datalabeling.v1beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.normalizedBoundingPoly != null && Object.hasOwnProperty.call(message, "normalizedBoundingPoly")) + $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.encode(message.normalizedBoundingPoly, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageBoundingPolyAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageBoundingPolyAnnotation} message ImageBoundingPolyAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageBoundingPolyAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageBoundingPolyAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation} ImageBoundingPolyAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageBoundingPolyAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.boundingPoly = $root.google.cloud.datalabeling.v1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 3: { + message.normalizedBoundingPoly = $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.decode(reader, reader.uint32()); + break; + } + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageBoundingPolyAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation} ImageBoundingPolyAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageBoundingPolyAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageBoundingPolyAnnotation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageBoundingPolyAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + properties.boundedArea = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + } + if (message.normalizedBoundingPoly != null && message.hasOwnProperty("normalizedBoundingPoly")) { + if (properties.boundedArea === 1) + return "boundedArea: multiple values"; + properties.boundedArea = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.verify(message.normalizedBoundingPoly); + if (error) + return "normalizedBoundingPoly." + error; + } + } + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + return null; + }; + + /** + * Creates an ImageBoundingPolyAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation} ImageBoundingPolyAnnotation + */ + ImageBoundingPolyAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.datalabeling.v1beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.normalizedBoundingPoly != null) { + if (typeof object.normalizedBoundingPoly !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.normalizedBoundingPoly: object expected"); + message.normalizedBoundingPoly = $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.fromObject(object.normalizedBoundingPoly); + } + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + return message; + }; + + /** + * Creates a plain object from an ImageBoundingPolyAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation} message ImageBoundingPolyAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageBoundingPolyAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.annotationSpec = null; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + object.boundingPoly = $root.google.cloud.datalabeling.v1beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (options.oneofs) + object.boundedArea = "boundingPoly"; + } + if (message.normalizedBoundingPoly != null && message.hasOwnProperty("normalizedBoundingPoly")) { + object.normalizedBoundingPoly = $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.toObject(message.normalizedBoundingPoly, options); + if (options.oneofs) + object.boundedArea = "normalizedBoundingPoly"; + } + return object; + }; + + /** + * Converts this ImageBoundingPolyAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @instance + * @returns {Object.} JSON object + */ + ImageBoundingPolyAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageBoundingPolyAnnotation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageBoundingPolyAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation"; + }; + + return ImageBoundingPolyAnnotation; + })(); + + v1beta1.Polyline = (function() { + + /** + * Properties of a Polyline. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IPolyline + * @property {Array.|null} [vertices] Polyline vertices + */ + + /** + * Constructs a new Polyline. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a Polyline. + * @implements IPolyline + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IPolyline=} [properties] Properties to set + */ + function Polyline(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]]; + } + + /** + * Polyline vertices. + * @member {Array.} vertices + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @instance + */ + Polyline.prototype.vertices = $util.emptyArray; + + /** + * Creates a new Polyline instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @static + * @param {google.cloud.datalabeling.v1beta1.IPolyline=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.Polyline} Polyline instance + */ + Polyline.create = function create(properties) { + return new Polyline(properties); + }; + + /** + * Encodes the specified Polyline message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Polyline.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @static + * @param {google.cloud.datalabeling.v1beta1.IPolyline} message Polyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polyline.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.datalabeling.v1beta1.Vertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Polyline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @static + * @param {google.cloud.datalabeling.v1beta1.IPolyline} message Polyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polyline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Polyline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.Polyline} Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polyline.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.Polyline(); + 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.datalabeling.v1beta1.Vertex.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Polyline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.Polyline} Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polyline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Polyline message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Polyline.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.datalabeling.v1beta1.Vertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + return null; + }; + + /** + * Creates a Polyline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.Polyline} Polyline + */ + Polyline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.Polyline) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.Polyline(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.datalabeling.v1beta1.Polyline.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Polyline.vertices: object expected"); + message.vertices[i] = $root.google.cloud.datalabeling.v1beta1.Vertex.fromObject(object.vertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Polyline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @static + * @param {google.cloud.datalabeling.v1beta1.Polyline} message Polyline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Polyline.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.datalabeling.v1beta1.Vertex.toObject(message.vertices[j], options); + } + return object; + }; + + /** + * Converts this Polyline to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @instance + * @returns {Object.} JSON object + */ + Polyline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Polyline + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.Polyline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Polyline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.Polyline"; + }; + + return Polyline; + })(); + + v1beta1.NormalizedPolyline = (function() { + + /** + * Properties of a NormalizedPolyline. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface INormalizedPolyline + * @property {Array.|null} [normalizedVertices] NormalizedPolyline normalizedVertices + */ + + /** + * Constructs a new NormalizedPolyline. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a NormalizedPolyline. + * @implements INormalizedPolyline + * @constructor + * @param {google.cloud.datalabeling.v1beta1.INormalizedPolyline=} [properties] Properties to set + */ + function NormalizedPolyline(properties) { + this.normalizedVertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedPolyline normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @instance + */ + NormalizedPolyline.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new NormalizedPolyline instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @static + * @param {google.cloud.datalabeling.v1beta1.INormalizedPolyline=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.NormalizedPolyline} NormalizedPolyline instance + */ + NormalizedPolyline.create = function create(properties) { + return new NormalizedPolyline(properties); + }; + + /** + * Encodes the specified NormalizedPolyline message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.NormalizedPolyline.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @static + * @param {google.cloud.datalabeling.v1beta1.INormalizedPolyline} message NormalizedPolyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedPolyline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.datalabeling.v1beta1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NormalizedPolyline message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.NormalizedPolyline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @static + * @param {google.cloud.datalabeling.v1beta1.INormalizedPolyline} message NormalizedPolyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedPolyline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedPolyline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.NormalizedPolyline} NormalizedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedPolyline.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.NormalizedPolyline(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.datalabeling.v1beta1.NormalizedVertex.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedPolyline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.NormalizedPolyline} NormalizedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedPolyline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedPolyline message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedPolyline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedVertices != null && message.hasOwnProperty("normalizedVertices")) { + if (!Array.isArray(message.normalizedVertices)) + return "normalizedVertices: array expected"; + for (var i = 0; i < message.normalizedVertices.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.NormalizedVertex.verify(message.normalizedVertices[i]); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a NormalizedPolyline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.NormalizedPolyline} NormalizedPolyline + */ + NormalizedPolyline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.NormalizedPolyline) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.NormalizedPolyline(); + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.datalabeling.v1beta1.NormalizedPolyline.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.NormalizedPolyline.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.datalabeling.v1beta1.NormalizedVertex.fromObject(object.normalizedVertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NormalizedPolyline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @static + * @param {google.cloud.datalabeling.v1beta1.NormalizedPolyline} message NormalizedPolyline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedPolyline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.normalizedVertices = []; + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.datalabeling.v1beta1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this NormalizedPolyline to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @instance + * @returns {Object.} JSON object + */ + NormalizedPolyline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedPolyline + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.NormalizedPolyline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedPolyline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.NormalizedPolyline"; + }; + + return NormalizedPolyline; + })(); + + v1beta1.ImagePolylineAnnotation = (function() { + + /** + * Properties of an ImagePolylineAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IImagePolylineAnnotation + * @property {google.cloud.datalabeling.v1beta1.IPolyline|null} [polyline] ImagePolylineAnnotation polyline + * @property {google.cloud.datalabeling.v1beta1.INormalizedPolyline|null} [normalizedPolyline] ImagePolylineAnnotation normalizedPolyline + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] ImagePolylineAnnotation annotationSpec + */ + + /** + * Constructs a new ImagePolylineAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ImagePolylineAnnotation. + * @implements IImagePolylineAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation=} [properties] Properties to set + */ + function ImagePolylineAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImagePolylineAnnotation polyline. + * @member {google.cloud.datalabeling.v1beta1.IPolyline|null|undefined} polyline + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @instance + */ + ImagePolylineAnnotation.prototype.polyline = null; + + /** + * ImagePolylineAnnotation normalizedPolyline. + * @member {google.cloud.datalabeling.v1beta1.INormalizedPolyline|null|undefined} normalizedPolyline + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @instance + */ + ImagePolylineAnnotation.prototype.normalizedPolyline = null; + + /** + * ImagePolylineAnnotation annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @instance + */ + ImagePolylineAnnotation.prototype.annotationSpec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImagePolylineAnnotation poly. + * @member {"polyline"|"normalizedPolyline"|undefined} poly + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @instance + */ + Object.defineProperty(ImagePolylineAnnotation.prototype, "poly", { + get: $util.oneOfGetter($oneOfFields = ["polyline", "normalizedPolyline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImagePolylineAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation} ImagePolylineAnnotation instance + */ + ImagePolylineAnnotation.create = function create(properties) { + return new ImagePolylineAnnotation(properties); + }; + + /** + * Encodes the specified ImagePolylineAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation} message ImagePolylineAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImagePolylineAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) + $root.google.cloud.datalabeling.v1beta1.Polyline.encode(message.polyline, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.normalizedPolyline != null && Object.hasOwnProperty.call(message, "normalizedPolyline")) + $root.google.cloud.datalabeling.v1beta1.NormalizedPolyline.encode(message.normalizedPolyline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImagePolylineAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImagePolylineAnnotation} message ImagePolylineAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImagePolylineAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImagePolylineAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation} ImagePolylineAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImagePolylineAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.polyline = $root.google.cloud.datalabeling.v1beta1.Polyline.decode(reader, reader.uint32()); + break; + } + case 3: { + message.normalizedPolyline = $root.google.cloud.datalabeling.v1beta1.NormalizedPolyline.decode(reader, reader.uint32()); + break; + } + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImagePolylineAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation} ImagePolylineAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImagePolylineAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImagePolylineAnnotation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImagePolylineAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.polyline != null && message.hasOwnProperty("polyline")) { + properties.poly = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.Polyline.verify(message.polyline); + if (error) + return "polyline." + error; + } + } + if (message.normalizedPolyline != null && message.hasOwnProperty("normalizedPolyline")) { + if (properties.poly === 1) + return "poly: multiple values"; + properties.poly = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.NormalizedPolyline.verify(message.normalizedPolyline); + if (error) + return "normalizedPolyline." + error; + } + } + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + return null; + }; + + /** + * Creates an ImagePolylineAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation} ImagePolylineAnnotation + */ + ImagePolylineAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation(); + if (object.polyline != null) { + if (typeof object.polyline !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.polyline: object expected"); + message.polyline = $root.google.cloud.datalabeling.v1beta1.Polyline.fromObject(object.polyline); + } + if (object.normalizedPolyline != null) { + if (typeof object.normalizedPolyline !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.normalizedPolyline: object expected"); + message.normalizedPolyline = $root.google.cloud.datalabeling.v1beta1.NormalizedPolyline.fromObject(object.normalizedPolyline); + } + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + return message; + }; + + /** + * Creates a plain object from an ImagePolylineAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation} message ImagePolylineAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImagePolylineAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.annotationSpec = null; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + if (message.polyline != null && message.hasOwnProperty("polyline")) { + object.polyline = $root.google.cloud.datalabeling.v1beta1.Polyline.toObject(message.polyline, options); + if (options.oneofs) + object.poly = "polyline"; + } + if (message.normalizedPolyline != null && message.hasOwnProperty("normalizedPolyline")) { + object.normalizedPolyline = $root.google.cloud.datalabeling.v1beta1.NormalizedPolyline.toObject(message.normalizedPolyline, options); + if (options.oneofs) + object.poly = "normalizedPolyline"; + } + return object; + }; + + /** + * Converts this ImagePolylineAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @instance + * @returns {Object.} JSON object + */ + ImagePolylineAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImagePolylineAnnotation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImagePolylineAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation"; + }; + + return ImagePolylineAnnotation; + })(); + + v1beta1.ImageSegmentationAnnotation = (function() { + + /** + * Properties of an ImageSegmentationAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IImageSegmentationAnnotation + * @property {Object.|null} [annotationColors] ImageSegmentationAnnotation annotationColors + * @property {string|null} [mimeType] ImageSegmentationAnnotation mimeType + * @property {Uint8Array|null} [imageBytes] ImageSegmentationAnnotation imageBytes + */ + + /** + * Constructs a new ImageSegmentationAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ImageSegmentationAnnotation. + * @implements IImageSegmentationAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation=} [properties] Properties to set + */ + function ImageSegmentationAnnotation(properties) { + this.annotationColors = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageSegmentationAnnotation annotationColors. + * @member {Object.} annotationColors + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @instance + */ + ImageSegmentationAnnotation.prototype.annotationColors = $util.emptyObject; + + /** + * ImageSegmentationAnnotation mimeType. + * @member {string} mimeType + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @instance + */ + ImageSegmentationAnnotation.prototype.mimeType = ""; + + /** + * ImageSegmentationAnnotation imageBytes. + * @member {Uint8Array} imageBytes + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @instance + */ + ImageSegmentationAnnotation.prototype.imageBytes = $util.newBuffer([]); + + /** + * Creates a new ImageSegmentationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation} ImageSegmentationAnnotation instance + */ + ImageSegmentationAnnotation.create = function create(properties) { + return new ImageSegmentationAnnotation(properties); + }; + + /** + * Encodes the specified ImageSegmentationAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation} message ImageSegmentationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSegmentationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationColors != null && Object.hasOwnProperty.call(message, "annotationColors")) + for (var keys = Object.keys(message.annotationColors), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationColors[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.imageBytes != null && Object.hasOwnProperty.call(message, "imageBytes")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.imageBytes); + return writer; + }; + + /** + * Encodes the specified ImageSegmentationAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageSegmentationAnnotation} message ImageSegmentationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSegmentationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageSegmentationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation} ImageSegmentationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSegmentationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.annotationColors === $util.emptyObject) + message.annotationColors = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotationColors[key] = value; + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 3: { + message.imageBytes = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageSegmentationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation} ImageSegmentationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSegmentationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageSegmentationAnnotation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageSegmentationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationColors != null && message.hasOwnProperty("annotationColors")) { + if (!$util.isObject(message.annotationColors)) + return "annotationColors: object expected"; + var key = Object.keys(message.annotationColors); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationColors[key[i]]); + if (error) + return "annotationColors." + error; + } + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) + if (!(message.imageBytes && typeof message.imageBytes.length === "number" || $util.isString(message.imageBytes))) + return "imageBytes: buffer expected"; + return null; + }; + + /** + * Creates an ImageSegmentationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation} ImageSegmentationAnnotation + */ + ImageSegmentationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation(); + if (object.annotationColors) { + if (typeof object.annotationColors !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.annotationColors: object expected"); + message.annotationColors = {}; + for (var keys = Object.keys(object.annotationColors), i = 0; i < keys.length; ++i) { + if (typeof object.annotationColors[keys[i]] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.annotationColors: object expected"); + message.annotationColors[keys[i]] = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationColors[keys[i]]); + } + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.imageBytes != null) + if (typeof object.imageBytes === "string") + $util.base64.decode(object.imageBytes, message.imageBytes = $util.newBuffer($util.base64.length(object.imageBytes)), 0); + else if (object.imageBytes.length >= 0) + message.imageBytes = object.imageBytes; + return message; + }; + + /** + * Creates a plain object from an ImageSegmentationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation} message ImageSegmentationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageSegmentationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.annotationColors = {}; + if (options.defaults) { + object.mimeType = ""; + if (options.bytes === String) + object.imageBytes = ""; + else { + object.imageBytes = []; + if (options.bytes !== Array) + object.imageBytes = $util.newBuffer(object.imageBytes); + } + } + var keys2; + if (message.annotationColors && (keys2 = Object.keys(message.annotationColors)).length) { + object.annotationColors = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotationColors[keys2[j]] = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationColors[keys2[j]], options); + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) + object.imageBytes = options.bytes === String ? $util.base64.encode(message.imageBytes, 0, message.imageBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.imageBytes) : message.imageBytes; + return object; + }; + + /** + * Converts this ImageSegmentationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @instance + * @returns {Object.} JSON object + */ + ImageSegmentationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageSegmentationAnnotation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageSegmentationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation"; + }; + + return ImageSegmentationAnnotation; + })(); + + v1beta1.TextClassificationAnnotation = (function() { + + /** + * Properties of a TextClassificationAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ITextClassificationAnnotation + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] TextClassificationAnnotation annotationSpec + */ + + /** + * Constructs a new TextClassificationAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a TextClassificationAnnotation. + * @implements ITextClassificationAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation=} [properties] Properties to set + */ + function TextClassificationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationAnnotation annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @instance + */ + TextClassificationAnnotation.prototype.annotationSpec = null; + + /** + * Creates a new TextClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.TextClassificationAnnotation} TextClassificationAnnotation instance + */ + TextClassificationAnnotation.create = function create(properties) { + return new TextClassificationAnnotation(properties); + }; + + /** + * Encodes the specified TextClassificationAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation} message TextClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextClassificationAnnotation} message TextClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.TextClassificationAnnotation} TextClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.TextClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.TextClassificationAnnotation} TextClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationAnnotation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + return null; + }; + + /** + * Creates a TextClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.TextClassificationAnnotation} TextClassificationAnnotation + */ + TextClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.TextClassificationAnnotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.TextClassificationAnnotation(); + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.TextClassificationAnnotation} message TextClassificationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.annotationSpec = null; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + return object; + }; + + /** + * Converts this TextClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextClassificationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationAnnotation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.TextClassificationAnnotation"; + }; + + return TextClassificationAnnotation; + })(); + + v1beta1.TextEntityExtractionAnnotation = (function() { + + /** + * Properties of a TextEntityExtractionAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ITextEntityExtractionAnnotation + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] TextEntityExtractionAnnotation annotationSpec + * @property {google.cloud.datalabeling.v1beta1.ISequentialSegment|null} [sequentialSegment] TextEntityExtractionAnnotation sequentialSegment + */ + + /** + * Constructs a new TextEntityExtractionAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a TextEntityExtractionAnnotation. + * @implements ITextEntityExtractionAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation=} [properties] Properties to set + */ + function TextEntityExtractionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextEntityExtractionAnnotation annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @instance + */ + TextEntityExtractionAnnotation.prototype.annotationSpec = null; + + /** + * TextEntityExtractionAnnotation sequentialSegment. + * @member {google.cloud.datalabeling.v1beta1.ISequentialSegment|null|undefined} sequentialSegment + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @instance + */ + TextEntityExtractionAnnotation.prototype.sequentialSegment = null; + + /** + * Creates a new TextEntityExtractionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation} TextEntityExtractionAnnotation instance + */ + TextEntityExtractionAnnotation.create = function create(properties) { + return new TextEntityExtractionAnnotation(properties); + }; + + /** + * Encodes the specified TextEntityExtractionAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation} message TextEntityExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextEntityExtractionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sequentialSegment != null && Object.hasOwnProperty.call(message, "sequentialSegment")) + $root.google.cloud.datalabeling.v1beta1.SequentialSegment.encode(message.sequentialSegment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextEntityExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextEntityExtractionAnnotation} message TextEntityExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextEntityExtractionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextEntityExtractionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation} TextEntityExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextEntityExtractionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.sequentialSegment = $root.google.cloud.datalabeling.v1beta1.SequentialSegment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextEntityExtractionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation} TextEntityExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextEntityExtractionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextEntityExtractionAnnotation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextEntityExtractionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + if (message.sequentialSegment != null && message.hasOwnProperty("sequentialSegment")) { + var error = $root.google.cloud.datalabeling.v1beta1.SequentialSegment.verify(message.sequentialSegment); + if (error) + return "sequentialSegment." + error; + } + return null; + }; + + /** + * Creates a TextEntityExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation} TextEntityExtractionAnnotation + */ + TextEntityExtractionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation(); + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + if (object.sequentialSegment != null) { + if (typeof object.sequentialSegment !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.sequentialSegment: object expected"); + message.sequentialSegment = $root.google.cloud.datalabeling.v1beta1.SequentialSegment.fromObject(object.sequentialSegment); + } + return message; + }; + + /** + * Creates a plain object from a TextEntityExtractionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation} message TextEntityExtractionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextEntityExtractionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpec = null; + object.sequentialSegment = null; + } + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + if (message.sequentialSegment != null && message.hasOwnProperty("sequentialSegment")) + object.sequentialSegment = $root.google.cloud.datalabeling.v1beta1.SequentialSegment.toObject(message.sequentialSegment, options); + return object; + }; + + /** + * Converts this TextEntityExtractionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextEntityExtractionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextEntityExtractionAnnotation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextEntityExtractionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation"; + }; + + return TextEntityExtractionAnnotation; + })(); + + v1beta1.SequentialSegment = (function() { + + /** + * Properties of a SequentialSegment. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ISequentialSegment + * @property {number|null} [start] SequentialSegment start + * @property {number|null} [end] SequentialSegment end + */ + + /** + * Constructs a new SequentialSegment. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a SequentialSegment. + * @implements ISequentialSegment + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ISequentialSegment=} [properties] Properties to set + */ + function SequentialSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SequentialSegment start. + * @member {number} start + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @instance + */ + SequentialSegment.prototype.start = 0; + + /** + * SequentialSegment end. + * @member {number} end + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @instance + */ + SequentialSegment.prototype.end = 0; + + /** + * Creates a new SequentialSegment instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @static + * @param {google.cloud.datalabeling.v1beta1.ISequentialSegment=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.SequentialSegment} SequentialSegment instance + */ + SequentialSegment.create = function create(properties) { + return new SequentialSegment(properties); + }; + + /** + * Encodes the specified SequentialSegment message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SequentialSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @static + * @param {google.cloud.datalabeling.v1beta1.ISequentialSegment} message SequentialSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SequentialSegment.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 SequentialSegment message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SequentialSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @static + * @param {google.cloud.datalabeling.v1beta1.ISequentialSegment} message SequentialSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SequentialSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SequentialSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.SequentialSegment} SequentialSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SequentialSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.SequentialSegment(); + 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 SequentialSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.SequentialSegment} SequentialSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SequentialSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SequentialSegment message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SequentialSegment.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 SequentialSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.SequentialSegment} SequentialSegment + */ + SequentialSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.SequentialSegment) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.SequentialSegment(); + 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 SequentialSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @static + * @param {google.cloud.datalabeling.v1beta1.SequentialSegment} message SequentialSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SequentialSegment.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 SequentialSegment to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @instance + * @returns {Object.} JSON object + */ + SequentialSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SequentialSegment + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.SequentialSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SequentialSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.SequentialSegment"; + }; + + return SequentialSegment; + })(); + + v1beta1.TimeSegment = (function() { + + /** + * Properties of a TimeSegment. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ITimeSegment + * @property {google.protobuf.IDuration|null} [startTimeOffset] TimeSegment startTimeOffset + * @property {google.protobuf.IDuration|null} [endTimeOffset] TimeSegment endTimeOffset + */ + + /** + * Constructs a new TimeSegment. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a TimeSegment. + * @implements ITimeSegment + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ITimeSegment=} [properties] Properties to set + */ + function TimeSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeSegment startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @instance + */ + TimeSegment.prototype.startTimeOffset = null; + + /** + * TimeSegment endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @instance + */ + TimeSegment.prototype.endTimeOffset = null; + + /** + * Creates a new TimeSegment instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @static + * @param {google.cloud.datalabeling.v1beta1.ITimeSegment=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.TimeSegment} TimeSegment instance + */ + TimeSegment.create = function create(properties) { + return new TimeSegment(properties); + }; + + /** + * Encodes the specified TimeSegment message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TimeSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @static + * @param {google.cloud.datalabeling.v1beta1.ITimeSegment} message TimeSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSegment.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 TimeSegment message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TimeSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @static + * @param {google.cloud.datalabeling.v1beta1.ITimeSegment} message TimeSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.TimeSegment} TimeSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.TimeSegment(); + 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 TimeSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.TimeSegment} TimeSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSegment message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSegment.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 TimeSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.TimeSegment} TimeSegment + */ + TimeSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.TimeSegment) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.TimeSegment(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.TimeSegment.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.datalabeling.v1beta1.TimeSegment.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from a TimeSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @static + * @param {google.cloud.datalabeling.v1beta1.TimeSegment} message TimeSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSegment.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 TimeSegment to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @instance + * @returns {Object.} JSON object + */ + TimeSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeSegment + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.TimeSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.TimeSegment"; + }; + + return TimeSegment; + })(); + + v1beta1.VideoClassificationAnnotation = (function() { + + /** + * Properties of a VideoClassificationAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IVideoClassificationAnnotation + * @property {google.cloud.datalabeling.v1beta1.ITimeSegment|null} [timeSegment] VideoClassificationAnnotation timeSegment + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] VideoClassificationAnnotation annotationSpec + */ + + /** + * Constructs a new VideoClassificationAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a VideoClassificationAnnotation. + * @implements IVideoClassificationAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation=} [properties] Properties to set + */ + function VideoClassificationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoClassificationAnnotation timeSegment. + * @member {google.cloud.datalabeling.v1beta1.ITimeSegment|null|undefined} timeSegment + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @instance + */ + VideoClassificationAnnotation.prototype.timeSegment = null; + + /** + * VideoClassificationAnnotation annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @instance + */ + VideoClassificationAnnotation.prototype.annotationSpec = null; + + /** + * Creates a new VideoClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation instance + */ + VideoClassificationAnnotation.create = function create(properties) { + return new VideoClassificationAnnotation(properties); + }; + + /** + * Encodes the specified VideoClassificationAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation} message VideoClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeSegment != null && Object.hasOwnProperty.call(message, "timeSegment")) + $root.google.cloud.datalabeling.v1beta1.TimeSegment.encode(message.timeSegment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoClassificationAnnotation} message VideoClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoClassificationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeSegment = $root.google.cloud.datalabeling.v1beta1.TimeSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoClassificationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoClassificationAnnotation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoClassificationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) { + var error = $root.google.cloud.datalabeling.v1beta1.TimeSegment.verify(message.timeSegment); + if (error) + return "timeSegment." + error; + } + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + return null; + }; + + /** + * Creates a VideoClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation + */ + VideoClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation(); + if (object.timeSegment != null) { + if (typeof object.timeSegment !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.timeSegment: object expected"); + message.timeSegment = $root.google.cloud.datalabeling.v1beta1.TimeSegment.fromObject(object.timeSegment); + } + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + return message; + }; + + /** + * Creates a plain object from a VideoClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation} message VideoClassificationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoClassificationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeSegment = null; + object.annotationSpec = null; + } + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) + object.timeSegment = $root.google.cloud.datalabeling.v1beta1.TimeSegment.toObject(message.timeSegment, options); + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + return object; + }; + + /** + * Converts this VideoClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @instance + * @returns {Object.} JSON object + */ + VideoClassificationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoClassificationAnnotation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoClassificationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation"; + }; + + return VideoClassificationAnnotation; + })(); + + v1beta1.ObjectTrackingFrame = (function() { + + /** + * Properties of an ObjectTrackingFrame. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IObjectTrackingFrame + * @property {google.cloud.datalabeling.v1beta1.IBoundingPoly|null} [boundingPoly] ObjectTrackingFrame boundingPoly + * @property {google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly|null} [normalizedBoundingPoly] ObjectTrackingFrame normalizedBoundingPoly + * @property {google.protobuf.IDuration|null} [timeOffset] ObjectTrackingFrame timeOffset + */ + + /** + * Constructs a new ObjectTrackingFrame. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ObjectTrackingFrame. + * @implements IObjectTrackingFrame + * @constructor + * @param {google.cloud.datalabeling.v1beta1.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 boundingPoly. + * @member {google.cloud.datalabeling.v1beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingFrame + * @instance + */ + ObjectTrackingFrame.prototype.boundingPoly = null; + + /** + * ObjectTrackingFrame normalizedBoundingPoly. + * @member {google.cloud.datalabeling.v1beta1.INormalizedBoundingPoly|null|undefined} normalizedBoundingPoly + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingFrame + * @instance + */ + ObjectTrackingFrame.prototype.normalizedBoundingPoly = null; + + /** + * ObjectTrackingFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingFrame + * @instance + */ + ObjectTrackingFrame.prototype.timeOffset = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ObjectTrackingFrame boundedArea. + * @member {"boundingPoly"|"normalizedBoundingPoly"|undefined} boundedArea + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingFrame + * @instance + */ + Object.defineProperty(ObjectTrackingFrame.prototype, "boundedArea", { + get: $util.oneOfGetter($oneOfFields = ["boundingPoly", "normalizedBoundingPoly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ObjectTrackingFrame instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.datalabeling.v1beta1.IObjectTrackingFrame=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ObjectTrackingFrame} ObjectTrackingFrame instance + */ + ObjectTrackingFrame.create = function create(properties) { + return new ObjectTrackingFrame(properties); + }; + + /** + * Encodes the specified ObjectTrackingFrame message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.datalabeling.v1beta1.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.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) + $root.google.cloud.datalabeling.v1beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.normalizedBoundingPoly != null && Object.hasOwnProperty.call(message, "normalizedBoundingPoly")) + $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.encode(message.normalizedBoundingPoly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingFrame message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.ObjectTrackingFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.ObjectTrackingFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.boundingPoly = $root.google.cloud.datalabeling.v1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 2: { + message.normalizedBoundingPoly = $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.decode(reader, reader.uint32()); + break; + } + case 3: { + 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.datalabeling.v1beta1.ObjectTrackingFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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"; + var properties = {}; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + properties.boundedArea = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + } + if (message.normalizedBoundingPoly != null && message.hasOwnProperty("normalizedBoundingPoly")) { + if (properties.boundedArea === 1) + return "boundedArea: multiple values"; + properties.boundedArea = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.verify(message.normalizedBoundingPoly); + if (error) + return "normalizedBoundingPoly." + 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.datalabeling.v1beta1.ObjectTrackingFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ObjectTrackingFrame} ObjectTrackingFrame + */ + ObjectTrackingFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ObjectTrackingFrame) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ObjectTrackingFrame(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.datalabeling.v1beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.normalizedBoundingPoly != null) { + if (typeof object.normalizedBoundingPoly !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.normalizedBoundingPoly: object expected"); + message.normalizedBoundingPoly = $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.fromObject(object.normalizedBoundingPoly); + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.datalabeling.v1beta1.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.timeOffset = null; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + object.boundingPoly = $root.google.cloud.datalabeling.v1beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (options.oneofs) + object.boundedArea = "boundingPoly"; + } + if (message.normalizedBoundingPoly != null && message.hasOwnProperty("normalizedBoundingPoly")) { + object.normalizedBoundingPoly = $root.google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.toObject(message.normalizedBoundingPoly, options); + if (options.oneofs) + object.boundedArea = "normalizedBoundingPoly"; + } + 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.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.ObjectTrackingFrame"; + }; + + return ObjectTrackingFrame; + })(); + + v1beta1.VideoObjectTrackingAnnotation = (function() { + + /** + * Properties of a VideoObjectTrackingAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IVideoObjectTrackingAnnotation + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] VideoObjectTrackingAnnotation annotationSpec + * @property {google.cloud.datalabeling.v1beta1.ITimeSegment|null} [timeSegment] VideoObjectTrackingAnnotation timeSegment + * @property {Array.|null} [objectTrackingFrames] VideoObjectTrackingAnnotation objectTrackingFrames + */ + + /** + * Constructs a new VideoObjectTrackingAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a VideoObjectTrackingAnnotation. + * @implements IVideoObjectTrackingAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation=} [properties] Properties to set + */ + function VideoObjectTrackingAnnotation(properties) { + this.objectTrackingFrames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoObjectTrackingAnnotation annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.annotationSpec = null; + + /** + * VideoObjectTrackingAnnotation timeSegment. + * @member {google.cloud.datalabeling.v1beta1.ITimeSegment|null|undefined} timeSegment + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.timeSegment = null; + + /** + * VideoObjectTrackingAnnotation objectTrackingFrames. + * @member {Array.} objectTrackingFrames + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.objectTrackingFrames = $util.emptyArray; + + /** + * Creates a new VideoObjectTrackingAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation instance + */ + VideoObjectTrackingAnnotation.create = function create(properties) { + return new VideoObjectTrackingAnnotation(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation} message VideoObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeSegment != null && Object.hasOwnProperty.call(message, "timeSegment")) + $root.google.cloud.datalabeling.v1beta1.TimeSegment.encode(message.timeSegment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.objectTrackingFrames != null && message.objectTrackingFrames.length) + for (var i = 0; i < message.objectTrackingFrames.length; ++i) + $root.google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.encode(message.objectTrackingFrames[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoObjectTrackingAnnotation} message VideoObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeSegment = $root.google.cloud.datalabeling.v1beta1.TimeSegment.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.objectTrackingFrames && message.objectTrackingFrames.length)) + message.objectTrackingFrames = []; + message.objectTrackingFrames.push($root.google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingAnnotation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) { + var error = $root.google.cloud.datalabeling.v1beta1.TimeSegment.verify(message.timeSegment); + if (error) + return "timeSegment." + error; + } + if (message.objectTrackingFrames != null && message.hasOwnProperty("objectTrackingFrames")) { + if (!Array.isArray(message.objectTrackingFrames)) + return "objectTrackingFrames: array expected"; + for (var i = 0; i < message.objectTrackingFrames.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.verify(message.objectTrackingFrames[i]); + if (error) + return "objectTrackingFrames." + error; + } + } + return null; + }; + + /** + * Creates a VideoObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation + */ + VideoObjectTrackingAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation(); + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + if (object.timeSegment != null) { + if (typeof object.timeSegment !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.timeSegment: object expected"); + message.timeSegment = $root.google.cloud.datalabeling.v1beta1.TimeSegment.fromObject(object.timeSegment); + } + if (object.objectTrackingFrames) { + if (!Array.isArray(object.objectTrackingFrames)) + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.objectTrackingFrames: array expected"); + message.objectTrackingFrames = []; + for (var i = 0; i < object.objectTrackingFrames.length; ++i) { + if (typeof object.objectTrackingFrames[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.objectTrackingFrames: object expected"); + message.objectTrackingFrames[i] = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.fromObject(object.objectTrackingFrames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VideoObjectTrackingAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation} message VideoObjectTrackingAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoObjectTrackingAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.objectTrackingFrames = []; + if (options.defaults) { + object.annotationSpec = null; + object.timeSegment = null; + } + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) + object.timeSegment = $root.google.cloud.datalabeling.v1beta1.TimeSegment.toObject(message.timeSegment, options); + if (message.objectTrackingFrames && message.objectTrackingFrames.length) { + object.objectTrackingFrames = []; + for (var j = 0; j < message.objectTrackingFrames.length; ++j) + object.objectTrackingFrames[j] = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.toObject(message.objectTrackingFrames[j], options); + } + return object; + }; + + /** + * Converts this VideoObjectTrackingAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @instance + * @returns {Object.} JSON object + */ + VideoObjectTrackingAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoObjectTrackingAnnotation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoObjectTrackingAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation"; + }; + + return VideoObjectTrackingAnnotation; + })(); + + v1beta1.VideoEventAnnotation = (function() { + + /** + * Properties of a VideoEventAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IVideoEventAnnotation + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] VideoEventAnnotation annotationSpec + * @property {google.cloud.datalabeling.v1beta1.ITimeSegment|null} [timeSegment] VideoEventAnnotation timeSegment + */ + + /** + * Constructs a new VideoEventAnnotation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a VideoEventAnnotation. + * @implements IVideoEventAnnotation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IVideoEventAnnotation=} [properties] Properties to set + */ + function VideoEventAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoEventAnnotation annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @instance + */ + VideoEventAnnotation.prototype.annotationSpec = null; + + /** + * VideoEventAnnotation timeSegment. + * @member {google.cloud.datalabeling.v1beta1.ITimeSegment|null|undefined} timeSegment + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @instance + */ + VideoEventAnnotation.prototype.timeSegment = null; + + /** + * Creates a new VideoEventAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoEventAnnotation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.VideoEventAnnotation} VideoEventAnnotation instance + */ + VideoEventAnnotation.create = function create(properties) { + return new VideoEventAnnotation(properties); + }; + + /** + * Encodes the specified VideoEventAnnotation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoEventAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoEventAnnotation} message VideoEventAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoEventAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeSegment != null && Object.hasOwnProperty.call(message, "timeSegment")) + $root.google.cloud.datalabeling.v1beta1.TimeSegment.encode(message.timeSegment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoEventAnnotation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoEventAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoEventAnnotation} message VideoEventAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoEventAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoEventAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.VideoEventAnnotation} VideoEventAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoEventAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.VideoEventAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeSegment = $root.google.cloud.datalabeling.v1beta1.TimeSegment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoEventAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.VideoEventAnnotation} VideoEventAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoEventAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoEventAnnotation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoEventAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) { + var error = $root.google.cloud.datalabeling.v1beta1.TimeSegment.verify(message.timeSegment); + if (error) + return "timeSegment." + error; + } + return null; + }; + + /** + * Creates a VideoEventAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.VideoEventAnnotation} VideoEventAnnotation + */ + VideoEventAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.VideoEventAnnotation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.VideoEventAnnotation(); + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoEventAnnotation.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + if (object.timeSegment != null) { + if (typeof object.timeSegment !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoEventAnnotation.timeSegment: object expected"); + message.timeSegment = $root.google.cloud.datalabeling.v1beta1.TimeSegment.fromObject(object.timeSegment); + } + return message; + }; + + /** + * Creates a plain object from a VideoEventAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoEventAnnotation} message VideoEventAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoEventAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpec = null; + object.timeSegment = null; + } + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) + object.timeSegment = $root.google.cloud.datalabeling.v1beta1.TimeSegment.toObject(message.timeSegment, options); + return object; + }; + + /** + * Converts this VideoEventAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @instance + * @returns {Object.} JSON object + */ + VideoEventAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoEventAnnotation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.VideoEventAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoEventAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.VideoEventAnnotation"; + }; + + return VideoEventAnnotation; + })(); + + v1beta1.AnnotationMetadata = (function() { + + /** + * Properties of an AnnotationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IAnnotationMetadata + * @property {google.cloud.datalabeling.v1beta1.IOperatorMetadata|null} [operatorMetadata] AnnotationMetadata operatorMetadata + */ + + /** + * Constructs a new AnnotationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an AnnotationMetadata. + * @implements IAnnotationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IAnnotationMetadata=} [properties] Properties to set + */ + function AnnotationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationMetadata operatorMetadata. + * @member {google.cloud.datalabeling.v1beta1.IOperatorMetadata|null|undefined} operatorMetadata + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @instance + */ + AnnotationMetadata.prototype.operatorMetadata = null; + + /** + * Creates a new AnnotationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.AnnotationMetadata} AnnotationMetadata instance + */ + AnnotationMetadata.create = function create(properties) { + return new AnnotationMetadata(properties); + }; + + /** + * Encodes the specified AnnotationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationMetadata} message AnnotationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operatorMetadata != null && Object.hasOwnProperty.call(message, "operatorMetadata")) + $root.google.cloud.datalabeling.v1beta1.OperatorMetadata.encode(message.operatorMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationMetadata} message AnnotationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.AnnotationMetadata} AnnotationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.AnnotationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.operatorMetadata = $root.google.cloud.datalabeling.v1beta1.OperatorMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.AnnotationMetadata} AnnotationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operatorMetadata != null && message.hasOwnProperty("operatorMetadata")) { + var error = $root.google.cloud.datalabeling.v1beta1.OperatorMetadata.verify(message.operatorMetadata); + if (error) + return "operatorMetadata." + error; + } + return null; + }; + + /** + * Creates an AnnotationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.AnnotationMetadata} AnnotationMetadata + */ + AnnotationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.AnnotationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.AnnotationMetadata(); + if (object.operatorMetadata != null) { + if (typeof object.operatorMetadata !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationMetadata.operatorMetadata: object expected"); + message.operatorMetadata = $root.google.cloud.datalabeling.v1beta1.OperatorMetadata.fromObject(object.operatorMetadata); + } + return message; + }; + + /** + * Creates a plain object from an AnnotationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.AnnotationMetadata} message AnnotationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.operatorMetadata = null; + if (message.operatorMetadata != null && message.hasOwnProperty("operatorMetadata")) + object.operatorMetadata = $root.google.cloud.datalabeling.v1beta1.OperatorMetadata.toObject(message.operatorMetadata, options); + return object; + }; + + /** + * Converts this AnnotationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @instance + * @returns {Object.} JSON object + */ + AnnotationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.AnnotationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.AnnotationMetadata"; + }; + + return AnnotationMetadata; + })(); + + v1beta1.OperatorMetadata = (function() { + + /** + * Properties of an OperatorMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IOperatorMetadata + * @property {number|null} [score] OperatorMetadata score + * @property {number|null} [totalVotes] OperatorMetadata totalVotes + * @property {number|null} [labelVotes] OperatorMetadata labelVotes + * @property {Array.|null} [comments] OperatorMetadata comments + */ + + /** + * Constructs a new OperatorMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an OperatorMetadata. + * @implements IOperatorMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IOperatorMetadata=} [properties] Properties to set + */ + function OperatorMetadata(properties) { + this.comments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperatorMetadata score. + * @member {number} score + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @instance + */ + OperatorMetadata.prototype.score = 0; + + /** + * OperatorMetadata totalVotes. + * @member {number} totalVotes + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @instance + */ + OperatorMetadata.prototype.totalVotes = 0; + + /** + * OperatorMetadata labelVotes. + * @member {number} labelVotes + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @instance + */ + OperatorMetadata.prototype.labelVotes = 0; + + /** + * OperatorMetadata comments. + * @member {Array.} comments + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @instance + */ + OperatorMetadata.prototype.comments = $util.emptyArray; + + /** + * Creates a new OperatorMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IOperatorMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.OperatorMetadata} OperatorMetadata instance + */ + OperatorMetadata.create = function create(properties) { + return new OperatorMetadata(properties); + }; + + /** + * Encodes the specified OperatorMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.OperatorMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IOperatorMetadata} message OperatorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperatorMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.totalVotes != null && Object.hasOwnProperty.call(message, "totalVotes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalVotes); + if (message.labelVotes != null && Object.hasOwnProperty.call(message, "labelVotes")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.labelVotes); + if (message.comments != null && message.comments.length) + for (var i = 0; i < message.comments.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.comments[i]); + return writer; + }; + + /** + * Encodes the specified OperatorMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.OperatorMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IOperatorMetadata} message OperatorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperatorMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperatorMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.OperatorMetadata} OperatorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperatorMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.OperatorMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + case 2: { + message.totalVotes = reader.int32(); + break; + } + case 3: { + message.labelVotes = reader.int32(); + break; + } + case 4: { + if (!(message.comments && message.comments.length)) + message.comments = []; + message.comments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperatorMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.OperatorMetadata} OperatorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperatorMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperatorMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperatorMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.totalVotes != null && message.hasOwnProperty("totalVotes")) + if (!$util.isInteger(message.totalVotes)) + return "totalVotes: integer expected"; + if (message.labelVotes != null && message.hasOwnProperty("labelVotes")) + if (!$util.isInteger(message.labelVotes)) + return "labelVotes: integer expected"; + if (message.comments != null && message.hasOwnProperty("comments")) { + if (!Array.isArray(message.comments)) + return "comments: array expected"; + for (var i = 0; i < message.comments.length; ++i) + if (!$util.isString(message.comments[i])) + return "comments: string[] expected"; + } + return null; + }; + + /** + * Creates an OperatorMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.OperatorMetadata} OperatorMetadata + */ + OperatorMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.OperatorMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.OperatorMetadata(); + if (object.score != null) + message.score = Number(object.score); + if (object.totalVotes != null) + message.totalVotes = object.totalVotes | 0; + if (object.labelVotes != null) + message.labelVotes = object.labelVotes | 0; + if (object.comments) { + if (!Array.isArray(object.comments)) + throw TypeError(".google.cloud.datalabeling.v1beta1.OperatorMetadata.comments: array expected"); + message.comments = []; + for (var i = 0; i < object.comments.length; ++i) + message.comments[i] = String(object.comments[i]); + } + return message; + }; + + /** + * Creates a plain object from an OperatorMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.OperatorMetadata} message OperatorMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperatorMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.comments = []; + if (options.defaults) { + object.score = 0; + object.totalVotes = 0; + object.labelVotes = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.totalVotes != null && message.hasOwnProperty("totalVotes")) + object.totalVotes = message.totalVotes; + if (message.labelVotes != null && message.hasOwnProperty("labelVotes")) + object.labelVotes = message.labelVotes; + if (message.comments && message.comments.length) { + object.comments = []; + for (var j = 0; j < message.comments.length; ++j) + object.comments[j] = message.comments[j]; + } + return object; + }; + + /** + * Converts this OperatorMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @instance + * @returns {Object.} JSON object + */ + OperatorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperatorMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.OperatorMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperatorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.OperatorMetadata"; + }; + + return OperatorMetadata; + })(); + + v1beta1.AnnotationSpecSet = (function() { + + /** + * Properties of an AnnotationSpecSet. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IAnnotationSpecSet + * @property {string|null} [name] AnnotationSpecSet name + * @property {string|null} [displayName] AnnotationSpecSet displayName + * @property {string|null} [description] AnnotationSpecSet description + * @property {Array.|null} [annotationSpecs] AnnotationSpecSet annotationSpecs + * @property {Array.|null} [blockingResources] AnnotationSpecSet blockingResources + */ + + /** + * Constructs a new AnnotationSpecSet. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an AnnotationSpecSet. + * @implements IAnnotationSpecSet + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IAnnotationSpecSet=} [properties] Properties to set + */ + function AnnotationSpecSet(properties) { + this.annotationSpecs = []; + this.blockingResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationSpecSet name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @instance + */ + AnnotationSpecSet.prototype.name = ""; + + /** + * AnnotationSpecSet displayName. + * @member {string} displayName + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @instance + */ + AnnotationSpecSet.prototype.displayName = ""; + + /** + * AnnotationSpecSet description. + * @member {string} description + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @instance + */ + AnnotationSpecSet.prototype.description = ""; + + /** + * AnnotationSpecSet annotationSpecs. + * @member {Array.} annotationSpecs + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @instance + */ + AnnotationSpecSet.prototype.annotationSpecs = $util.emptyArray; + + /** + * AnnotationSpecSet blockingResources. + * @member {Array.} blockingResources + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @instance + */ + AnnotationSpecSet.prototype.blockingResources = $util.emptyArray; + + /** + * Creates a new AnnotationSpecSet instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationSpecSet=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.AnnotationSpecSet} AnnotationSpecSet instance + */ + AnnotationSpecSet.create = function create(properties) { + return new AnnotationSpecSet(properties); + }; + + /** + * Encodes the specified AnnotationSpecSet message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationSpecSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationSpecSet} message AnnotationSpecSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpecSet.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); + if (message.annotationSpecs != null && message.annotationSpecs.length) + for (var i = 0; i < message.annotationSpecs.length; ++i) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpecs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.blockingResources != null && message.blockingResources.length) + for (var i = 0; i < message.blockingResources.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.blockingResources[i]); + return writer; + }; + + /** + * Encodes the specified AnnotationSpecSet message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationSpecSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationSpecSet} message AnnotationSpecSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpecSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationSpecSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.AnnotationSpecSet} AnnotationSpecSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpecSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet(); + 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; + } + case 4: { + if (!(message.annotationSpecs && message.annotationSpecs.length)) + message.annotationSpecs = []; + message.annotationSpecs.push($root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.blockingResources && message.blockingResources.length)) + message.blockingResources = []; + message.blockingResources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationSpecSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.AnnotationSpecSet} AnnotationSpecSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpecSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationSpecSet message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationSpecSet.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"; + if (message.annotationSpecs != null && message.hasOwnProperty("annotationSpecs")) { + if (!Array.isArray(message.annotationSpecs)) + return "annotationSpecs: array expected"; + for (var i = 0; i < message.annotationSpecs.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpecs[i]); + if (error) + return "annotationSpecs." + error; + } + } + if (message.blockingResources != null && message.hasOwnProperty("blockingResources")) { + if (!Array.isArray(message.blockingResources)) + return "blockingResources: array expected"; + for (var i = 0; i < message.blockingResources.length; ++i) + if (!$util.isString(message.blockingResources[i])) + return "blockingResources: string[] expected"; + } + return null; + }; + + /** + * Creates an AnnotationSpecSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.AnnotationSpecSet} AnnotationSpecSet + */ + AnnotationSpecSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet(); + 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); + if (object.annotationSpecs) { + if (!Array.isArray(object.annotationSpecs)) + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationSpecSet.annotationSpecs: array expected"); + message.annotationSpecs = []; + for (var i = 0; i < object.annotationSpecs.length; ++i) { + if (typeof object.annotationSpecs[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationSpecSet.annotationSpecs: object expected"); + message.annotationSpecs[i] = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpecs[i]); + } + } + if (object.blockingResources) { + if (!Array.isArray(object.blockingResources)) + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotationSpecSet.blockingResources: array expected"); + message.blockingResources = []; + for (var i = 0; i < object.blockingResources.length; ++i) + message.blockingResources[i] = String(object.blockingResources[i]); + } + return message; + }; + + /** + * Creates a plain object from an AnnotationSpecSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @static + * @param {google.cloud.datalabeling.v1beta1.AnnotationSpecSet} message AnnotationSpecSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationSpecSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.annotationSpecs = []; + object.blockingResources = []; + } + 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; + if (message.annotationSpecs && message.annotationSpecs.length) { + object.annotationSpecs = []; + for (var j = 0; j < message.annotationSpecs.length; ++j) + object.annotationSpecs[j] = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpecs[j], options); + } + if (message.blockingResources && message.blockingResources.length) { + object.blockingResources = []; + for (var j = 0; j < message.blockingResources.length; ++j) + object.blockingResources[j] = message.blockingResources[j]; + } + return object; + }; + + /** + * Converts this AnnotationSpecSet to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @instance + * @returns {Object.} JSON object + */ + AnnotationSpecSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationSpecSet + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpecSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationSpecSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.AnnotationSpecSet"; + }; + + return AnnotationSpecSet; + })(); + + v1beta1.AnnotationSpec = (function() { + + /** + * Properties of an AnnotationSpec. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IAnnotationSpec + * @property {string|null} [displayName] AnnotationSpec displayName + * @property {string|null} [description] AnnotationSpec description + */ + + /** + * Constructs a new AnnotationSpec. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an AnnotationSpec. + * @implements IAnnotationSpec + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IAnnotationSpec=} [properties] Properties to set + */ + function AnnotationSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationSpec displayName. + * @member {string} displayName + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.displayName = ""; + + /** + * AnnotationSpec description. + * @member {string} description + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.description = ""; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationSpec=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.AnnotationSpec} AnnotationSpec instance + */ + AnnotationSpec.create = function create(properties) { + return new AnnotationSpec(properties); + }; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationSpec} message AnnotationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotationSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotationSpec} message AnnotationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.AnnotationSpec} AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.AnnotationSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.AnnotationSpec} AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationSpec message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 an AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.AnnotationSpec} AnnotationSpec + */ + AnnotationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.AnnotationSpec) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.AnnotationSpec(); + 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 an AnnotationSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.datalabeling.v1beta1.AnnotationSpec} message AnnotationSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.description = ""; + } + 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 AnnotationSpec to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @instance + * @returns {Object.} JSON object + */ + AnnotationSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationSpec + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.AnnotationSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.AnnotationSpec"; + }; + + return AnnotationSpec; + })(); + + v1beta1.DataLabelingService = (function() { + + /** + * Constructs a new DataLabelingService service. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a DataLabelingService + * @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 DataLabelingService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DataLabelingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataLabelingService; + + /** + * Creates new DataLabelingService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @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 {DataLabelingService} RPC service. Useful where requests and/or responses are streamed. + */ + DataLabelingService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|createDataset}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef CreateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.Dataset} [response] Dataset + */ + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.CreateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.createDataset = function createDataset(request, callback) { + return this.rpcCall(createDataset, $root.google.cloud.datalabeling.v1beta1.CreateDatasetRequest, $root.google.cloud.datalabeling.v1beta1.Dataset, request, callback); + }, "name", { value: "CreateDataset" }); + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getDataset}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef GetDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.Dataset} [response] Dataset + */ + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.GetDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.getDataset = function getDataset(request, callback) { + return this.rpcCall(getDataset, $root.google.cloud.datalabeling.v1beta1.GetDatasetRequest, $root.google.cloud.datalabeling.v1beta1.Dataset, request, callback); + }, "name", { value: "GetDataset" }); + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listDatasets}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ListDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.ListDatasetsResponse} [response] ListDatasetsResponse + */ + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ListDatasetsCallback} callback Node-style callback called with the error, if any, and ListDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.listDatasets = function listDatasets(request, callback) { + return this.rpcCall(listDatasets, $root.google.cloud.datalabeling.v1beta1.ListDatasetsRequest, $root.google.cloud.datalabeling.v1beta1.ListDatasetsResponse, request, callback); + }, "name", { value: "ListDatasets" }); + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteDataset}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef DeleteDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteDatasetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.deleteDataset = function deleteDataset(request, callback) { + return this.rpcCall(deleteDataset, $root.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDataset" }); + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|importData}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ImportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IImportDataRequest} request ImportDataRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ImportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.importData = function importData(request, callback) { + return this.rpcCall(importData, $root.google.cloud.datalabeling.v1beta1.ImportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportData" }); + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IImportDataRequest} request ImportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|exportData}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ExportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IExportDataRequest} request ExportDataRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ExportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.exportData = function exportData(request, callback) { + return this.rpcCall(exportData, $root.google.cloud.datalabeling.v1beta1.ExportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportData" }); + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IExportDataRequest} request ExportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getDataItem}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef GetDataItemCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.DataItem} [response] DataItem + */ + + /** + * Calls GetDataItem. + * @function getDataItem + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetDataItemRequest} request GetDataItemRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataItemCallback} callback Node-style callback called with the error, if any, and DataItem + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.getDataItem = function getDataItem(request, callback) { + return this.rpcCall(getDataItem, $root.google.cloud.datalabeling.v1beta1.GetDataItemRequest, $root.google.cloud.datalabeling.v1beta1.DataItem, request, callback); + }, "name", { value: "GetDataItem" }); + + /** + * Calls GetDataItem. + * @function getDataItem + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetDataItemRequest} request GetDataItemRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listDataItems}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ListDataItemsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.ListDataItemsResponse} [response] ListDataItemsResponse + */ + + /** + * Calls ListDataItems. + * @function listDataItems + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsRequest} request ListDataItemsRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ListDataItemsCallback} callback Node-style callback called with the error, if any, and ListDataItemsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.listDataItems = function listDataItems(request, callback) { + return this.rpcCall(listDataItems, $root.google.cloud.datalabeling.v1beta1.ListDataItemsRequest, $root.google.cloud.datalabeling.v1beta1.ListDataItemsResponse, request, callback); + }, "name", { value: "ListDataItems" }); + + /** + * Calls ListDataItems. + * @function listDataItems + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsRequest} request ListDataItemsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getAnnotatedDataset}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef GetAnnotatedDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.AnnotatedDataset} [response] AnnotatedDataset + */ + + /** + * Calls GetAnnotatedDataset. + * @function getAnnotatedDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest} request GetAnnotatedDatasetRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotatedDatasetCallback} callback Node-style callback called with the error, if any, and AnnotatedDataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.getAnnotatedDataset = function getAnnotatedDataset(request, callback) { + return this.rpcCall(getAnnotatedDataset, $root.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest, $root.google.cloud.datalabeling.v1beta1.AnnotatedDataset, request, callback); + }, "name", { value: "GetAnnotatedDataset" }); + + /** + * Calls GetAnnotatedDataset. + * @function getAnnotatedDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest} request GetAnnotatedDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listAnnotatedDatasets}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ListAnnotatedDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse} [response] ListAnnotatedDatasetsResponse + */ + + /** + * Calls ListAnnotatedDatasets. + * @function listAnnotatedDatasets + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest} request ListAnnotatedDatasetsRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotatedDatasetsCallback} callback Node-style callback called with the error, if any, and ListAnnotatedDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.listAnnotatedDatasets = function listAnnotatedDatasets(request, callback) { + return this.rpcCall(listAnnotatedDatasets, $root.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest, $root.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse, request, callback); + }, "name", { value: "ListAnnotatedDatasets" }); + + /** + * Calls ListAnnotatedDatasets. + * @function listAnnotatedDatasets + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest} request ListAnnotatedDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteAnnotatedDataset}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef DeleteAnnotatedDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAnnotatedDataset. + * @function deleteAnnotatedDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest} request DeleteAnnotatedDatasetRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotatedDatasetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.deleteAnnotatedDataset = function deleteAnnotatedDataset(request, callback) { + return this.rpcCall(deleteAnnotatedDataset, $root.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAnnotatedDataset" }); + + /** + * Calls DeleteAnnotatedDataset. + * @function deleteAnnotatedDataset + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest} request DeleteAnnotatedDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|labelImage}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef LabelImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LabelImage. + * @function labelImage + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ILabelImageRequest} request LabelImageRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.LabelImageCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.labelImage = function labelImage(request, callback) { + return this.rpcCall(labelImage, $root.google.cloud.datalabeling.v1beta1.LabelImageRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LabelImage" }); + + /** + * Calls LabelImage. + * @function labelImage + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ILabelImageRequest} request LabelImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|labelVideo}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef LabelVideoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LabelVideo. + * @function labelVideo + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoRequest} request LabelVideoRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.LabelVideoCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.labelVideo = function labelVideo(request, callback) { + return this.rpcCall(labelVideo, $root.google.cloud.datalabeling.v1beta1.LabelVideoRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LabelVideo" }); + + /** + * Calls LabelVideo. + * @function labelVideo + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoRequest} request LabelVideoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|labelText}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef LabelTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LabelText. + * @function labelText + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ILabelTextRequest} request LabelTextRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.LabelTextCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.labelText = function labelText(request, callback) { + return this.rpcCall(labelText, $root.google.cloud.datalabeling.v1beta1.LabelTextRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LabelText" }); + + /** + * Calls LabelText. + * @function labelText + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ILabelTextRequest} request LabelTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getExample}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef GetExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.Example} [response] Example + */ + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetExampleRequest} request GetExampleRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.GetExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.getExample = function getExample(request, callback) { + return this.rpcCall(getExample, $root.google.cloud.datalabeling.v1beta1.GetExampleRequest, $root.google.cloud.datalabeling.v1beta1.Example, request, callback); + }, "name", { value: "GetExample" }); + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetExampleRequest} request GetExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listExamples}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ListExamplesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.ListExamplesResponse} [response] ListExamplesResponse + */ + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListExamplesRequest} request ListExamplesRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ListExamplesCallback} callback Node-style callback called with the error, if any, and ListExamplesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.listExamples = function listExamples(request, callback) { + return this.rpcCall(listExamples, $root.google.cloud.datalabeling.v1beta1.ListExamplesRequest, $root.google.cloud.datalabeling.v1beta1.ListExamplesResponse, request, callback); + }, "name", { value: "ListExamples" }); + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListExamplesRequest} request ListExamplesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|createAnnotationSpecSet}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef CreateAnnotationSpecSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.AnnotationSpecSet} [response] AnnotationSpecSet + */ + + /** + * Calls CreateAnnotationSpecSet. + * @function createAnnotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest} request CreateAnnotationSpecSetRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.CreateAnnotationSpecSetCallback} callback Node-style callback called with the error, if any, and AnnotationSpecSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.createAnnotationSpecSet = function createAnnotationSpecSet(request, callback) { + return this.rpcCall(createAnnotationSpecSet, $root.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest, $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet, request, callback); + }, "name", { value: "CreateAnnotationSpecSet" }); + + /** + * Calls CreateAnnotationSpecSet. + * @function createAnnotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest} request CreateAnnotationSpecSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getAnnotationSpecSet}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef GetAnnotationSpecSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.AnnotationSpecSet} [response] AnnotationSpecSet + */ + + /** + * Calls GetAnnotationSpecSet. + * @function getAnnotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest} request GetAnnotationSpecSetRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotationSpecSetCallback} callback Node-style callback called with the error, if any, and AnnotationSpecSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.getAnnotationSpecSet = function getAnnotationSpecSet(request, callback) { + return this.rpcCall(getAnnotationSpecSet, $root.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest, $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet, request, callback); + }, "name", { value: "GetAnnotationSpecSet" }); + + /** + * Calls GetAnnotationSpecSet. + * @function getAnnotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest} request GetAnnotationSpecSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listAnnotationSpecSets}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ListAnnotationSpecSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse} [response] ListAnnotationSpecSetsResponse + */ + + /** + * Calls ListAnnotationSpecSets. + * @function listAnnotationSpecSets + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest} request ListAnnotationSpecSetsRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotationSpecSetsCallback} callback Node-style callback called with the error, if any, and ListAnnotationSpecSetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.listAnnotationSpecSets = function listAnnotationSpecSets(request, callback) { + return this.rpcCall(listAnnotationSpecSets, $root.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest, $root.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse, request, callback); + }, "name", { value: "ListAnnotationSpecSets" }); + + /** + * Calls ListAnnotationSpecSets. + * @function listAnnotationSpecSets + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest} request ListAnnotationSpecSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteAnnotationSpecSet}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef DeleteAnnotationSpecSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAnnotationSpecSet. + * @function deleteAnnotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest} request DeleteAnnotationSpecSetRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotationSpecSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.deleteAnnotationSpecSet = function deleteAnnotationSpecSet(request, callback) { + return this.rpcCall(deleteAnnotationSpecSet, $root.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAnnotationSpecSet" }); + + /** + * Calls DeleteAnnotationSpecSet. + * @function deleteAnnotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest} request DeleteAnnotationSpecSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|createInstruction}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef CreateInstructionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstruction. + * @function createInstruction + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionRequest} request CreateInstructionRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.CreateInstructionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.createInstruction = function createInstruction(request, callback) { + return this.rpcCall(createInstruction, $root.google.cloud.datalabeling.v1beta1.CreateInstructionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstruction" }); + + /** + * Calls CreateInstruction. + * @function createInstruction + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionRequest} request CreateInstructionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getInstruction}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef GetInstructionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.Instruction} [response] Instruction + */ + + /** + * Calls GetInstruction. + * @function getInstruction + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetInstructionRequest} request GetInstructionRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.GetInstructionCallback} callback Node-style callback called with the error, if any, and Instruction + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.getInstruction = function getInstruction(request, callback) { + return this.rpcCall(getInstruction, $root.google.cloud.datalabeling.v1beta1.GetInstructionRequest, $root.google.cloud.datalabeling.v1beta1.Instruction, request, callback); + }, "name", { value: "GetInstruction" }); + + /** + * Calls GetInstruction. + * @function getInstruction + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetInstructionRequest} request GetInstructionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listInstructions}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ListInstructionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.ListInstructionsResponse} [response] ListInstructionsResponse + */ + + /** + * Calls ListInstructions. + * @function listInstructions + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsRequest} request ListInstructionsRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ListInstructionsCallback} callback Node-style callback called with the error, if any, and ListInstructionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.listInstructions = function listInstructions(request, callback) { + return this.rpcCall(listInstructions, $root.google.cloud.datalabeling.v1beta1.ListInstructionsRequest, $root.google.cloud.datalabeling.v1beta1.ListInstructionsResponse, request, callback); + }, "name", { value: "ListInstructions" }); + + /** + * Calls ListInstructions. + * @function listInstructions + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsRequest} request ListInstructionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteInstruction}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef DeleteInstructionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteInstruction. + * @function deleteInstruction + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest} request DeleteInstructionRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteInstructionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.deleteInstruction = function deleteInstruction(request, callback) { + return this.rpcCall(deleteInstruction, $root.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteInstruction" }); + + /** + * Calls DeleteInstruction. + * @function deleteInstruction + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest} request DeleteInstructionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getEvaluation}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef GetEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.Evaluation} [response] Evaluation + */ + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.getEvaluation = function getEvaluation(request, callback) { + return this.rpcCall(getEvaluation, $root.google.cloud.datalabeling.v1beta1.GetEvaluationRequest, $root.google.cloud.datalabeling.v1beta1.Evaluation, request, callback); + }, "name", { value: "GetEvaluation" }); + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|searchEvaluations}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef SearchEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse} [response] SearchEvaluationsResponse + */ + + /** + * Calls SearchEvaluations. + * @function searchEvaluations + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest} request SearchEvaluationsRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluationsCallback} callback Node-style callback called with the error, if any, and SearchEvaluationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.searchEvaluations = function searchEvaluations(request, callback) { + return this.rpcCall(searchEvaluations, $root.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest, $root.google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse, request, callback); + }, "name", { value: "SearchEvaluations" }); + + /** + * Calls SearchEvaluations. + * @function searchEvaluations + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest} request SearchEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|searchExampleComparisons}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef SearchExampleComparisonsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse} [response] SearchExampleComparisonsResponse + */ + + /** + * Calls SearchExampleComparisons. + * @function searchExampleComparisons + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest} request SearchExampleComparisonsRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.SearchExampleComparisonsCallback} callback Node-style callback called with the error, if any, and SearchExampleComparisonsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.searchExampleComparisons = function searchExampleComparisons(request, callback) { + return this.rpcCall(searchExampleComparisons, $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest, $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse, request, callback); + }, "name", { value: "SearchExampleComparisons" }); + + /** + * Calls SearchExampleComparisons. + * @function searchExampleComparisons + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest} request SearchExampleComparisonsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|createEvaluationJob}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef CreateEvaluationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.EvaluationJob} [response] EvaluationJob + */ + + /** + * Calls CreateEvaluationJob. + * @function createEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest} request CreateEvaluationJobRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.CreateEvaluationJobCallback} callback Node-style callback called with the error, if any, and EvaluationJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.createEvaluationJob = function createEvaluationJob(request, callback) { + return this.rpcCall(createEvaluationJob, $root.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest, $root.google.cloud.datalabeling.v1beta1.EvaluationJob, request, callback); + }, "name", { value: "CreateEvaluationJob" }); + + /** + * Calls CreateEvaluationJob. + * @function createEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest} request CreateEvaluationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|updateEvaluationJob}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef UpdateEvaluationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.EvaluationJob} [response] EvaluationJob + */ + + /** + * Calls UpdateEvaluationJob. + * @function updateEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest} request UpdateEvaluationJobRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.UpdateEvaluationJobCallback} callback Node-style callback called with the error, if any, and EvaluationJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.updateEvaluationJob = function updateEvaluationJob(request, callback) { + return this.rpcCall(updateEvaluationJob, $root.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest, $root.google.cloud.datalabeling.v1beta1.EvaluationJob, request, callback); + }, "name", { value: "UpdateEvaluationJob" }); + + /** + * Calls UpdateEvaluationJob. + * @function updateEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest} request UpdateEvaluationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|getEvaluationJob}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef GetEvaluationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.EvaluationJob} [response] EvaluationJob + */ + + /** + * Calls GetEvaluationJob. + * @function getEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest} request GetEvaluationJobRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluationJobCallback} callback Node-style callback called with the error, if any, and EvaluationJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.getEvaluationJob = function getEvaluationJob(request, callback) { + return this.rpcCall(getEvaluationJob, $root.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest, $root.google.cloud.datalabeling.v1beta1.EvaluationJob, request, callback); + }, "name", { value: "GetEvaluationJob" }); + + /** + * Calls GetEvaluationJob. + * @function getEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest} request GetEvaluationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|pauseEvaluationJob}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef PauseEvaluationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls PauseEvaluationJob. + * @function pauseEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest} request PauseEvaluationJobRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.PauseEvaluationJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.pauseEvaluationJob = function pauseEvaluationJob(request, callback) { + return this.rpcCall(pauseEvaluationJob, $root.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "PauseEvaluationJob" }); + + /** + * Calls PauseEvaluationJob. + * @function pauseEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest} request PauseEvaluationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|resumeEvaluationJob}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ResumeEvaluationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls ResumeEvaluationJob. + * @function resumeEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest} request ResumeEvaluationJobRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ResumeEvaluationJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.resumeEvaluationJob = function resumeEvaluationJob(request, callback) { + return this.rpcCall(resumeEvaluationJob, $root.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ResumeEvaluationJob" }); + + /** + * Calls ResumeEvaluationJob. + * @function resumeEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest} request ResumeEvaluationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|deleteEvaluationJob}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef DeleteEvaluationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvaluationJob. + * @function deleteEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest} request DeleteEvaluationJobRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteEvaluationJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.deleteEvaluationJob = function deleteEvaluationJob(request, callback) { + return this.rpcCall(deleteEvaluationJob, $root.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvaluationJob" }); + + /** + * Calls DeleteEvaluationJob. + * @function deleteEvaluationJob + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest} request DeleteEvaluationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datalabeling.v1beta1.DataLabelingService|listEvaluationJobs}. + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @typedef ListEvaluationJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse} [response] ListEvaluationJobsResponse + */ + + /** + * Calls ListEvaluationJobs. + * @function listEvaluationJobs + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest} request ListEvaluationJobsRequest message or plain object + * @param {google.cloud.datalabeling.v1beta1.DataLabelingService.ListEvaluationJobsCallback} callback Node-style callback called with the error, if any, and ListEvaluationJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataLabelingService.prototype.listEvaluationJobs = function listEvaluationJobs(request, callback) { + return this.rpcCall(listEvaluationJobs, $root.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest, $root.google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse, request, callback); + }, "name", { value: "ListEvaluationJobs" }); + + /** + * Calls ListEvaluationJobs. + * @function listEvaluationJobs + * @memberof google.cloud.datalabeling.v1beta1.DataLabelingService + * @instance + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest} request ListEvaluationJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataLabelingService; + })(); + + v1beta1.CreateDatasetRequest = (function() { + + /** + * Properties of a CreateDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ICreateDatasetRequest + * @property {string|null} [parent] CreateDatasetRequest parent + * @property {google.cloud.datalabeling.v1beta1.IDataset|null} [dataset] CreateDatasetRequest dataset + */ + + /** + * Constructs a new CreateDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a CreateDatasetRequest. + * @implements ICreateDatasetRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ICreateDatasetRequest=} [properties] Properties to set + */ + function CreateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatasetRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.parent = ""; + + /** + * CreateDatasetRequest dataset. + * @member {google.cloud.datalabeling.v1beta1.IDataset|null|undefined} dataset + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.dataset = null; + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.CreateDatasetRequest} CreateDatasetRequest instance + */ + CreateDatasetRequest.create = function create(properties) { + return new CreateDatasetRequest(properties); + }; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.datalabeling.v1beta1.Dataset.encode(message.dataset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.CreateDatasetRequest} CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.CreateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dataset = $root.google.cloud.datalabeling.v1beta1.Dataset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.CreateDatasetRequest} CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatasetRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.datalabeling.v1beta1.Dataset.verify(message.dataset); + if (error) + return "dataset." + error; + } + return null; + }; + + /** + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.CreateDatasetRequest} CreateDatasetRequest + */ + CreateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.CreateDatasetRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.CreateDatasetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.CreateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.datalabeling.v1beta1.Dataset.fromObject(object.dataset); + } + return message; + }; + + /** + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.CreateDatasetRequest} message CreateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.datalabeling.v1beta1.Dataset.toObject(message.dataset, options); + return object; + }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.CreateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.CreateDatasetRequest"; + }; + + return CreateDatasetRequest; + })(); + + v1beta1.GetDatasetRequest = (function() { + + /** + * Properties of a GetDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGetDatasetRequest + * @property {string|null} [name] GetDatasetRequest name + */ + + /** + * Constructs a new GetDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GetDatasetRequest. + * @implements IGetDatasetRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGetDatasetRequest=} [properties] Properties to set + */ + function GetDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatasetRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.name = ""; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GetDatasetRequest} GetDatasetRequest instance + */ + GetDatasetRequest.create = function create(properties) { + return new GetDatasetRequest(properties); + }; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.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 GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GetDatasetRequest(); + 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 GetDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatasetRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatasetRequest.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 GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GetDatasetRequest} GetDatasetRequest + */ + GetDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GetDatasetRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GetDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.GetDatasetRequest} message GetDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatasetRequest.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 GetDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GetDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GetDatasetRequest"; + }; + + return GetDatasetRequest; + })(); + + v1beta1.ListDatasetsRequest = (function() { + + /** + * Properties of a ListDatasetsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListDatasetsRequest + * @property {string|null} [parent] ListDatasetsRequest parent + * @property {string|null} [filter] ListDatasetsRequest filter + * @property {number|null} [pageSize] ListDatasetsRequest pageSize + * @property {string|null} [pageToken] ListDatasetsRequest pageToken + */ + + /** + * Constructs a new ListDatasetsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListDatasetsRequest. + * @implements IListDatasetsRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsRequest=} [properties] Properties to set + */ + function ListDatasetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatasetsRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.parent = ""; + + /** + * ListDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.filter = ""; + + /** + * ListDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageSize = 0; + + /** + * ListDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListDatasetsRequest} ListDatasetsRequest instance + */ + ListDatasetsRequest.create = function create(properties) { + return new ListDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatasetsRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatasetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListDatasetsRequest} ListDatasetsRequest + */ + ListDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListDatasetsRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListDatasetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDatasetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ListDatasetsRequest} message ListDatasetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatasetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatasetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatasetsRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatasetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListDatasetsRequest"; + }; + + return ListDatasetsRequest; + })(); + + v1beta1.ListDatasetsResponse = (function() { + + /** + * Properties of a ListDatasetsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListDatasetsResponse + * @property {Array.|null} [datasets] ListDatasetsResponse datasets + * @property {string|null} [nextPageToken] ListDatasetsResponse nextPageToken + */ + + /** + * Constructs a new ListDatasetsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListDatasetsResponse. + * @implements IListDatasetsResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsResponse=} [properties] Properties to set + */ + function ListDatasetsResponse(properties) { + this.datasets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatasetsResponse datasets. + * @member {Array.} datasets + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.datasets = $util.emptyArray; + + /** + * ListDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListDatasetsResponse} ListDatasetsResponse instance + */ + ListDatasetsResponse.create = function create(properties) { + return new ListDatasetsResponse(properties); + }; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasets != null && message.datasets.length) + for (var i = 0; i < message.datasets.length; ++i) + $root.google.cloud.datalabeling.v1beta1.Dataset.encode(message.datasets[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 ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListDatasetsResponse} ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListDatasetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.datasets && message.datasets.length)) + message.datasets = []; + message.datasets.push($root.google.cloud.datalabeling.v1beta1.Dataset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListDatasetsResponse} ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatasetsResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatasetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datasets != null && message.hasOwnProperty("datasets")) { + if (!Array.isArray(message.datasets)) + return "datasets: array expected"; + for (var i = 0; i < message.datasets.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.Dataset.verify(message.datasets[i]); + if (error) + return "datasets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListDatasetsResponse} ListDatasetsResponse + */ + ListDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListDatasetsResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListDatasetsResponse(); + if (object.datasets) { + if (!Array.isArray(object.datasets)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ListDatasetsResponse.datasets: array expected"); + message.datasets = []; + for (var i = 0; i < object.datasets.length; ++i) { + if (typeof object.datasets[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ListDatasetsResponse.datasets: object expected"); + message.datasets[i] = $root.google.cloud.datalabeling.v1beta1.Dataset.fromObject(object.datasets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ListDatasetsResponse} message ListDatasetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatasetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.datasets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.datasets && message.datasets.length) { + object.datasets = []; + for (var j = 0; j < message.datasets.length; ++j) + object.datasets[j] = $root.google.cloud.datalabeling.v1beta1.Dataset.toObject(message.datasets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatasetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatasetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatasetsResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListDatasetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatasetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListDatasetsResponse"; + }; + + return ListDatasetsResponse; + })(); + + v1beta1.DeleteDatasetRequest = (function() { + + /** + * Properties of a DeleteDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IDeleteDatasetRequest + * @property {string|null} [name] DeleteDatasetRequest name + */ + + /** + * Constructs a new DeleteDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a DeleteDatasetRequest. + * @implements IDeleteDatasetRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest=} [properties] Properties to set + */ + function DeleteDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDatasetRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @instance + */ + DeleteDatasetRequest.prototype.name = ""; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest instance + */ + DeleteDatasetRequest.create = function create(properties) { + return new DeleteDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.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 DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest(); + 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 DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDatasetRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDatasetRequest.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 DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest + */ + DeleteDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.DeleteDatasetRequest} message DeleteDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDatasetRequest.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 DeleteDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.DeleteDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.DeleteDatasetRequest"; + }; + + return DeleteDatasetRequest; + })(); + + v1beta1.ImportDataRequest = (function() { + + /** + * Properties of an ImportDataRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IImportDataRequest + * @property {string|null} [name] ImportDataRequest name + * @property {google.cloud.datalabeling.v1beta1.IInputConfig|null} [inputConfig] ImportDataRequest inputConfig + * @property {string|null} [userEmailAddress] ImportDataRequest userEmailAddress + */ + + /** + * Constructs a new ImportDataRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ImportDataRequest. + * @implements IImportDataRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IImportDataRequest=} [properties] Properties to set + */ + function ImportDataRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDataRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.name = ""; + + /** + * ImportDataRequest inputConfig. + * @member {google.cloud.datalabeling.v1beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.inputConfig = null; + + /** + * ImportDataRequest userEmailAddress. + * @member {string} userEmailAddress + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.userEmailAddress = ""; + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IImportDataRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ImportDataRequest} ImportDataRequest instance + */ + ImportDataRequest.create = function create(properties) { + return new ImportDataRequest(properties); + }; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataRequest.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.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.datalabeling.v1beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.userEmailAddress != null && Object.hasOwnProperty.call(message, "userEmailAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userEmailAddress); + return writer; + }; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ImportDataRequest} ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ImportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputConfig = $root.google.cloud.datalabeling.v1beta1.InputConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.userEmailAddress = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ImportDataRequest} ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.userEmailAddress != null && message.hasOwnProperty("userEmailAddress")) + if (!$util.isString(message.userEmailAddress)) + return "userEmailAddress: string expected"; + return null; + }; + + /** + * Creates an ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ImportDataRequest} ImportDataRequest + */ + ImportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ImportDataRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ImportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImportDataRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.datalabeling.v1beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.userEmailAddress != null) + message.userEmailAddress = String(object.userEmailAddress); + return message; + }; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ImportDataRequest} message ImportDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.userEmailAddress = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.datalabeling.v1beta1.InputConfig.toObject(message.inputConfig, options); + if (message.userEmailAddress != null && message.hasOwnProperty("userEmailAddress")) + object.userEmailAddress = message.userEmailAddress; + return object; + }; + + /** + * Converts this ImportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @instance + * @returns {Object.} JSON object + */ + ImportDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ImportDataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ImportDataRequest"; + }; + + return ImportDataRequest; + })(); + + v1beta1.ExportDataRequest = (function() { + + /** + * Properties of an ExportDataRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IExportDataRequest + * @property {string|null} [name] ExportDataRequest name + * @property {string|null} [annotatedDataset] ExportDataRequest annotatedDataset + * @property {string|null} [filter] ExportDataRequest filter + * @property {google.cloud.datalabeling.v1beta1.IOutputConfig|null} [outputConfig] ExportDataRequest outputConfig + * @property {string|null} [userEmailAddress] ExportDataRequest userEmailAddress + */ + + /** + * Constructs a new ExportDataRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ExportDataRequest. + * @implements IExportDataRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IExportDataRequest=} [properties] Properties to set + */ + function ExportDataRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.name = ""; + + /** + * ExportDataRequest annotatedDataset. + * @member {string} annotatedDataset + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.annotatedDataset = ""; + + /** + * ExportDataRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.filter = ""; + + /** + * ExportDataRequest outputConfig. + * @member {google.cloud.datalabeling.v1beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.outputConfig = null; + + /** + * ExportDataRequest userEmailAddress. + * @member {string} userEmailAddress + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.userEmailAddress = ""; + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IExportDataRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ExportDataRequest} ExportDataRequest instance + */ + ExportDataRequest.create = function create(properties) { + return new ExportDataRequest(properties); + }; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataRequest.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.annotatedDataset != null && Object.hasOwnProperty.call(message, "annotatedDataset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.annotatedDataset); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.datalabeling.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.userEmailAddress != null && Object.hasOwnProperty.call(message, "userEmailAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.userEmailAddress); + return writer; + }; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ExportDataRequest} ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ExportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.annotatedDataset = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.outputConfig = $root.google.cloud.datalabeling.v1beta1.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.userEmailAddress = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ExportDataRequest} ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataRequest.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.annotatedDataset != null && message.hasOwnProperty("annotatedDataset")) + if (!$util.isString(message.annotatedDataset)) + return "annotatedDataset: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.userEmailAddress != null && message.hasOwnProperty("userEmailAddress")) + if (!$util.isString(message.userEmailAddress)) + return "userEmailAddress: string expected"; + return null; + }; + + /** + * Creates an ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ExportDataRequest} ExportDataRequest + */ + ExportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ExportDataRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ExportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.annotatedDataset != null) + message.annotatedDataset = String(object.annotatedDataset); + if (object.filter != null) + message.filter = String(object.filter); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ExportDataRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.datalabeling.v1beta1.OutputConfig.fromObject(object.outputConfig); + } + if (object.userEmailAddress != null) + message.userEmailAddress = String(object.userEmailAddress); + return message; + }; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ExportDataRequest} message ExportDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.annotatedDataset = ""; + object.filter = ""; + object.outputConfig = null; + object.userEmailAddress = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.annotatedDataset != null && message.hasOwnProperty("annotatedDataset")) + object.annotatedDataset = message.annotatedDataset; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.datalabeling.v1beta1.OutputConfig.toObject(message.outputConfig, options); + if (message.userEmailAddress != null && message.hasOwnProperty("userEmailAddress")) + object.userEmailAddress = message.userEmailAddress; + return object; + }; + + /** + * Converts this ExportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @instance + * @returns {Object.} JSON object + */ + ExportDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ExportDataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ExportDataRequest"; + }; + + return ExportDataRequest; + })(); + + v1beta1.GetDataItemRequest = (function() { + + /** + * Properties of a GetDataItemRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGetDataItemRequest + * @property {string|null} [name] GetDataItemRequest name + */ + + /** + * Constructs a new GetDataItemRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GetDataItemRequest. + * @implements IGetDataItemRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGetDataItemRequest=} [properties] Properties to set + */ + function GetDataItemRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataItemRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @instance + */ + GetDataItemRequest.prototype.name = ""; + + /** + * Creates a new GetDataItemRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetDataItemRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GetDataItemRequest} GetDataItemRequest instance + */ + GetDataItemRequest.create = function create(properties) { + return new GetDataItemRequest(properties); + }; + + /** + * Encodes the specified GetDataItemRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetDataItemRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetDataItemRequest} message GetDataItemRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataItemRequest.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 GetDataItemRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetDataItemRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetDataItemRequest} message GetDataItemRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataItemRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataItemRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GetDataItemRequest} GetDataItemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataItemRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GetDataItemRequest(); + 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 GetDataItemRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GetDataItemRequest} GetDataItemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataItemRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataItemRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataItemRequest.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 GetDataItemRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GetDataItemRequest} GetDataItemRequest + */ + GetDataItemRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GetDataItemRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GetDataItemRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataItemRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.GetDataItemRequest} message GetDataItemRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataItemRequest.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 GetDataItemRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataItemRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataItemRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GetDataItemRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataItemRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GetDataItemRequest"; + }; + + return GetDataItemRequest; + })(); + + v1beta1.ListDataItemsRequest = (function() { + + /** + * Properties of a ListDataItemsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListDataItemsRequest + * @property {string|null} [parent] ListDataItemsRequest parent + * @property {string|null} [filter] ListDataItemsRequest filter + * @property {number|null} [pageSize] ListDataItemsRequest pageSize + * @property {string|null} [pageToken] ListDataItemsRequest pageToken + */ + + /** + * Constructs a new ListDataItemsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListDataItemsRequest. + * @implements IListDataItemsRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsRequest=} [properties] Properties to set + */ + function ListDataItemsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataItemsRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @instance + */ + ListDataItemsRequest.prototype.parent = ""; + + /** + * ListDataItemsRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @instance + */ + ListDataItemsRequest.prototype.filter = ""; + + /** + * ListDataItemsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @instance + */ + ListDataItemsRequest.prototype.pageSize = 0; + + /** + * ListDataItemsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @instance + */ + ListDataItemsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDataItemsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListDataItemsRequest} ListDataItemsRequest instance + */ + ListDataItemsRequest.create = function create(properties) { + return new ListDataItemsRequest(properties); + }; + + /** + * Encodes the specified ListDataItemsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDataItemsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsRequest} message ListDataItemsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataItemsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDataItemsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDataItemsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsRequest} message ListDataItemsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataItemsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataItemsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListDataItemsRequest} ListDataItemsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataItemsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListDataItemsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataItemsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListDataItemsRequest} ListDataItemsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataItemsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataItemsRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataItemsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 ListDataItemsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListDataItemsRequest} ListDataItemsRequest + */ + ListDataItemsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListDataItemsRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListDataItemsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDataItemsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ListDataItemsRequest} message ListDataItemsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataItemsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListDataItemsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataItemsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataItemsRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataItemsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListDataItemsRequest"; + }; + + return ListDataItemsRequest; + })(); + + v1beta1.ListDataItemsResponse = (function() { + + /** + * Properties of a ListDataItemsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListDataItemsResponse + * @property {Array.|null} [dataItems] ListDataItemsResponse dataItems + * @property {string|null} [nextPageToken] ListDataItemsResponse nextPageToken + */ + + /** + * Constructs a new ListDataItemsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListDataItemsResponse. + * @implements IListDataItemsResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsResponse=} [properties] Properties to set + */ + function ListDataItemsResponse(properties) { + this.dataItems = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataItemsResponse dataItems. + * @member {Array.} dataItems + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @instance + */ + ListDataItemsResponse.prototype.dataItems = $util.emptyArray; + + /** + * ListDataItemsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @instance + */ + ListDataItemsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDataItemsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListDataItemsResponse} ListDataItemsResponse instance + */ + ListDataItemsResponse.create = function create(properties) { + return new ListDataItemsResponse(properties); + }; + + /** + * Encodes the specified ListDataItemsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDataItemsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsResponse} message ListDataItemsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataItemsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataItems != null && message.dataItems.length) + for (var i = 0; i < message.dataItems.length; ++i) + $root.google.cloud.datalabeling.v1beta1.DataItem.encode(message.dataItems[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 ListDataItemsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListDataItemsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListDataItemsResponse} message ListDataItemsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataItemsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataItemsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListDataItemsResponse} ListDataItemsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataItemsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListDataItemsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataItems && message.dataItems.length)) + message.dataItems = []; + message.dataItems.push($root.google.cloud.datalabeling.v1beta1.DataItem.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataItemsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListDataItemsResponse} ListDataItemsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataItemsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataItemsResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataItemsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataItems != null && message.hasOwnProperty("dataItems")) { + if (!Array.isArray(message.dataItems)) + return "dataItems: array expected"; + for (var i = 0; i < message.dataItems.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.DataItem.verify(message.dataItems[i]); + if (error) + return "dataItems." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDataItemsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListDataItemsResponse} ListDataItemsResponse + */ + ListDataItemsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListDataItemsResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListDataItemsResponse(); + if (object.dataItems) { + if (!Array.isArray(object.dataItems)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ListDataItemsResponse.dataItems: array expected"); + message.dataItems = []; + for (var i = 0; i < object.dataItems.length; ++i) { + if (typeof object.dataItems[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ListDataItemsResponse.dataItems: object expected"); + message.dataItems[i] = $root.google.cloud.datalabeling.v1beta1.DataItem.fromObject(object.dataItems[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDataItemsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ListDataItemsResponse} message ListDataItemsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataItemsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataItems = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataItems && message.dataItems.length) { + object.dataItems = []; + for (var j = 0; j < message.dataItems.length; ++j) + object.dataItems[j] = $root.google.cloud.datalabeling.v1beta1.DataItem.toObject(message.dataItems[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDataItemsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataItemsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataItemsResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListDataItemsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataItemsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListDataItemsResponse"; + }; + + return ListDataItemsResponse; + })(); + + v1beta1.GetAnnotatedDatasetRequest = (function() { + + /** + * Properties of a GetAnnotatedDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGetAnnotatedDatasetRequest + * @property {string|null} [name] GetAnnotatedDatasetRequest name + */ + + /** + * Constructs a new GetAnnotatedDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GetAnnotatedDatasetRequest. + * @implements IGetAnnotatedDatasetRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest=} [properties] Properties to set + */ + function GetAnnotatedDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnnotatedDatasetRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @instance + */ + GetAnnotatedDatasetRequest.prototype.name = ""; + + /** + * Creates a new GetAnnotatedDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest} GetAnnotatedDatasetRequest instance + */ + GetAnnotatedDatasetRequest.create = function create(properties) { + return new GetAnnotatedDatasetRequest(properties); + }; + + /** + * Encodes the specified GetAnnotatedDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest} message GetAnnotatedDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotatedDatasetRequest.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 GetAnnotatedDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest} message GetAnnotatedDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotatedDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnnotatedDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest} GetAnnotatedDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotatedDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest(); + 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 GetAnnotatedDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest} GetAnnotatedDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotatedDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnnotatedDatasetRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnnotatedDatasetRequest.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 GetAnnotatedDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest} GetAnnotatedDatasetRequest + */ + GetAnnotatedDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnnotatedDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest} message GetAnnotatedDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnnotatedDatasetRequest.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 GetAnnotatedDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnnotatedDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnnotatedDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnnotatedDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest"; + }; + + return GetAnnotatedDatasetRequest; + })(); + + v1beta1.ListAnnotatedDatasetsRequest = (function() { + + /** + * Properties of a ListAnnotatedDatasetsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListAnnotatedDatasetsRequest + * @property {string|null} [parent] ListAnnotatedDatasetsRequest parent + * @property {string|null} [filter] ListAnnotatedDatasetsRequest filter + * @property {number|null} [pageSize] ListAnnotatedDatasetsRequest pageSize + * @property {string|null} [pageToken] ListAnnotatedDatasetsRequest pageToken + */ + + /** + * Constructs a new ListAnnotatedDatasetsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListAnnotatedDatasetsRequest. + * @implements IListAnnotatedDatasetsRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest=} [properties] Properties to set + */ + function ListAnnotatedDatasetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnnotatedDatasetsRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @instance + */ + ListAnnotatedDatasetsRequest.prototype.parent = ""; + + /** + * ListAnnotatedDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @instance + */ + ListAnnotatedDatasetsRequest.prototype.filter = ""; + + /** + * ListAnnotatedDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @instance + */ + ListAnnotatedDatasetsRequest.prototype.pageSize = 0; + + /** + * ListAnnotatedDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @instance + */ + ListAnnotatedDatasetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAnnotatedDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest} ListAnnotatedDatasetsRequest instance + */ + ListAnnotatedDatasetsRequest.create = function create(properties) { + return new ListAnnotatedDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListAnnotatedDatasetsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest} message ListAnnotatedDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotatedDatasetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAnnotatedDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest} message ListAnnotatedDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotatedDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnnotatedDatasetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest} ListAnnotatedDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotatedDatasetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnnotatedDatasetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest} ListAnnotatedDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotatedDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnnotatedDatasetsRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnnotatedDatasetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 ListAnnotatedDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest} ListAnnotatedDatasetsRequest + */ + ListAnnotatedDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListAnnotatedDatasetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest} message ListAnnotatedDatasetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnnotatedDatasetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListAnnotatedDatasetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAnnotatedDatasetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnnotatedDatasetsRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnnotatedDatasetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest"; + }; + + return ListAnnotatedDatasetsRequest; + })(); + + v1beta1.ListAnnotatedDatasetsResponse = (function() { + + /** + * Properties of a ListAnnotatedDatasetsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListAnnotatedDatasetsResponse + * @property {Array.|null} [annotatedDatasets] ListAnnotatedDatasetsResponse annotatedDatasets + * @property {string|null} [nextPageToken] ListAnnotatedDatasetsResponse nextPageToken + */ + + /** + * Constructs a new ListAnnotatedDatasetsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListAnnotatedDatasetsResponse. + * @implements IListAnnotatedDatasetsResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse=} [properties] Properties to set + */ + function ListAnnotatedDatasetsResponse(properties) { + this.annotatedDatasets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnnotatedDatasetsResponse annotatedDatasets. + * @member {Array.} annotatedDatasets + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @instance + */ + ListAnnotatedDatasetsResponse.prototype.annotatedDatasets = $util.emptyArray; + + /** + * ListAnnotatedDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @instance + */ + ListAnnotatedDatasetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAnnotatedDatasetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse} ListAnnotatedDatasetsResponse instance + */ + ListAnnotatedDatasetsResponse.create = function create(properties) { + return new ListAnnotatedDatasetsResponse(properties); + }; + + /** + * Encodes the specified ListAnnotatedDatasetsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse} message ListAnnotatedDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotatedDatasetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotatedDatasets != null && message.annotatedDatasets.length) + for (var i = 0; i < message.annotatedDatasets.length; ++i) + $root.google.cloud.datalabeling.v1beta1.AnnotatedDataset.encode(message.annotatedDatasets[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 ListAnnotatedDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse} message ListAnnotatedDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotatedDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnnotatedDatasetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse} ListAnnotatedDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotatedDatasetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotatedDatasets && message.annotatedDatasets.length)) + message.annotatedDatasets = []; + message.annotatedDatasets.push($root.google.cloud.datalabeling.v1beta1.AnnotatedDataset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnnotatedDatasetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse} ListAnnotatedDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotatedDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnnotatedDatasetsResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnnotatedDatasetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotatedDatasets != null && message.hasOwnProperty("annotatedDatasets")) { + if (!Array.isArray(message.annotatedDatasets)) + return "annotatedDatasets: array expected"; + for (var i = 0; i < message.annotatedDatasets.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotatedDataset.verify(message.annotatedDatasets[i]); + if (error) + return "annotatedDatasets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAnnotatedDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse} ListAnnotatedDatasetsResponse + */ + ListAnnotatedDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse(); + if (object.annotatedDatasets) { + if (!Array.isArray(object.annotatedDatasets)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.annotatedDatasets: array expected"); + message.annotatedDatasets = []; + for (var i = 0; i < object.annotatedDatasets.length; ++i) { + if (typeof object.annotatedDatasets[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.annotatedDatasets: object expected"); + message.annotatedDatasets[i] = $root.google.cloud.datalabeling.v1beta1.AnnotatedDataset.fromObject(object.annotatedDatasets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAnnotatedDatasetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse} message ListAnnotatedDatasetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnnotatedDatasetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotatedDatasets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.annotatedDatasets && message.annotatedDatasets.length) { + object.annotatedDatasets = []; + for (var j = 0; j < message.annotatedDatasets.length; ++j) + object.annotatedDatasets[j] = $root.google.cloud.datalabeling.v1beta1.AnnotatedDataset.toObject(message.annotatedDatasets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAnnotatedDatasetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAnnotatedDatasetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnnotatedDatasetsResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnnotatedDatasetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse"; + }; + + return ListAnnotatedDatasetsResponse; + })(); + + v1beta1.DeleteAnnotatedDatasetRequest = (function() { + + /** + * Properties of a DeleteAnnotatedDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IDeleteAnnotatedDatasetRequest + * @property {string|null} [name] DeleteAnnotatedDatasetRequest name + */ + + /** + * Constructs a new DeleteAnnotatedDatasetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a DeleteAnnotatedDatasetRequest. + * @implements IDeleteAnnotatedDatasetRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest=} [properties] Properties to set + */ + function DeleteAnnotatedDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAnnotatedDatasetRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @instance + */ + DeleteAnnotatedDatasetRequest.prototype.name = ""; + + /** + * Creates a new DeleteAnnotatedDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest} DeleteAnnotatedDatasetRequest instance + */ + DeleteAnnotatedDatasetRequest.create = function create(properties) { + return new DeleteAnnotatedDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteAnnotatedDatasetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest} message DeleteAnnotatedDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAnnotatedDatasetRequest.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 DeleteAnnotatedDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest} message DeleteAnnotatedDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAnnotatedDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAnnotatedDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest} DeleteAnnotatedDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAnnotatedDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest(); + 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 DeleteAnnotatedDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest} DeleteAnnotatedDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAnnotatedDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAnnotatedDatasetRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAnnotatedDatasetRequest.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 DeleteAnnotatedDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest} DeleteAnnotatedDatasetRequest + */ + DeleteAnnotatedDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAnnotatedDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest} message DeleteAnnotatedDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAnnotatedDatasetRequest.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 DeleteAnnotatedDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAnnotatedDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAnnotatedDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAnnotatedDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest"; + }; + + return DeleteAnnotatedDatasetRequest; + })(); + + v1beta1.LabelImageRequest = (function() { + + /** + * Properties of a LabelImageRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelImageRequest + * @property {google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null} [imageClassificationConfig] LabelImageRequest imageClassificationConfig + * @property {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null} [boundingPolyConfig] LabelImageRequest boundingPolyConfig + * @property {google.cloud.datalabeling.v1beta1.IPolylineConfig|null} [polylineConfig] LabelImageRequest polylineConfig + * @property {google.cloud.datalabeling.v1beta1.ISegmentationConfig|null} [segmentationConfig] LabelImageRequest segmentationConfig + * @property {string|null} [parent] LabelImageRequest parent + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelImageRequest basicConfig + * @property {google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature|null} [feature] LabelImageRequest feature + */ + + /** + * Constructs a new LabelImageRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelImageRequest. + * @implements ILabelImageRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelImageRequest=} [properties] Properties to set + */ + function LabelImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelImageRequest imageClassificationConfig. + * @member {google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null|undefined} imageClassificationConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @instance + */ + LabelImageRequest.prototype.imageClassificationConfig = null; + + /** + * LabelImageRequest boundingPolyConfig. + * @member {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null|undefined} boundingPolyConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @instance + */ + LabelImageRequest.prototype.boundingPolyConfig = null; + + /** + * LabelImageRequest polylineConfig. + * @member {google.cloud.datalabeling.v1beta1.IPolylineConfig|null|undefined} polylineConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @instance + */ + LabelImageRequest.prototype.polylineConfig = null; + + /** + * LabelImageRequest segmentationConfig. + * @member {google.cloud.datalabeling.v1beta1.ISegmentationConfig|null|undefined} segmentationConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @instance + */ + LabelImageRequest.prototype.segmentationConfig = null; + + /** + * LabelImageRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @instance + */ + LabelImageRequest.prototype.parent = ""; + + /** + * LabelImageRequest basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @instance + */ + LabelImageRequest.prototype.basicConfig = null; + + /** + * LabelImageRequest feature. + * @member {google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature} feature + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @instance + */ + LabelImageRequest.prototype.feature = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LabelImageRequest requestConfig. + * @member {"imageClassificationConfig"|"boundingPolyConfig"|"polylineConfig"|"segmentationConfig"|undefined} requestConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @instance + */ + Object.defineProperty(LabelImageRequest.prototype, "requestConfig", { + get: $util.oneOfGetter($oneOfFields = ["imageClassificationConfig", "boundingPolyConfig", "polylineConfig", "segmentationConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LabelImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelImageRequest} LabelImageRequest instance + */ + LabelImageRequest.create = function create(properties) { + return new LabelImageRequest(properties); + }; + + /** + * Encodes the specified LabelImageRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageRequest} message LabelImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.feature != null && Object.hasOwnProperty.call(message, "feature")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.feature); + if (message.imageClassificationConfig != null && Object.hasOwnProperty.call(message, "imageClassificationConfig")) + $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.encode(message.imageClassificationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.boundingPolyConfig != null && Object.hasOwnProperty.call(message, "boundingPolyConfig")) + $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.encode(message.boundingPolyConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.polylineConfig != null && Object.hasOwnProperty.call(message, "polylineConfig")) + $root.google.cloud.datalabeling.v1beta1.PolylineConfig.encode(message.polylineConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.segmentationConfig != null && Object.hasOwnProperty.call(message, "segmentationConfig")) + $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.encode(message.segmentationConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelImageRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageRequest} message LabelImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelImageRequest} LabelImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.imageClassificationConfig = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.boundingPolyConfig = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.polylineConfig = $root.google.cloud.datalabeling.v1beta1.PolylineConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.segmentationConfig = $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.feature = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelImageRequest} LabelImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelImageRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageClassificationConfig != null && message.hasOwnProperty("imageClassificationConfig")) { + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.verify(message.imageClassificationConfig); + if (error) + return "imageClassificationConfig." + error; + } + } + if (message.boundingPolyConfig != null && message.hasOwnProperty("boundingPolyConfig")) { + if (properties.requestConfig === 1) + return "requestConfig: multiple values"; + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.verify(message.boundingPolyConfig); + if (error) + return "boundingPolyConfig." + error; + } + } + if (message.polylineConfig != null && message.hasOwnProperty("polylineConfig")) { + if (properties.requestConfig === 1) + return "requestConfig: multiple values"; + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.PolylineConfig.verify(message.polylineConfig); + if (error) + return "polylineConfig." + error; + } + } + if (message.segmentationConfig != null && message.hasOwnProperty("segmentationConfig")) { + if (properties.requestConfig === 1) + return "requestConfig: multiple values"; + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.verify(message.segmentationConfig); + if (error) + return "segmentationConfig." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + if (message.feature != null && message.hasOwnProperty("feature")) + switch (message.feature) { + default: + return "feature: enum value expected"; + case 0: + case 1: + case 2: + case 6: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a LabelImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelImageRequest} LabelImageRequest + */ + LabelImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelImageRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelImageRequest(); + if (object.imageClassificationConfig != null) { + if (typeof object.imageClassificationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageRequest.imageClassificationConfig: object expected"); + message.imageClassificationConfig = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.fromObject(object.imageClassificationConfig); + } + if (object.boundingPolyConfig != null) { + if (typeof object.boundingPolyConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageRequest.boundingPolyConfig: object expected"); + message.boundingPolyConfig = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.fromObject(object.boundingPolyConfig); + } + if (object.polylineConfig != null) { + if (typeof object.polylineConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageRequest.polylineConfig: object expected"); + message.polylineConfig = $root.google.cloud.datalabeling.v1beta1.PolylineConfig.fromObject(object.polylineConfig); + } + if (object.segmentationConfig != null) { + if (typeof object.segmentationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageRequest.segmentationConfig: object expected"); + message.segmentationConfig = $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.fromObject(object.segmentationConfig); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageRequest.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + 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 "CLASSIFICATION": + case 1: + message.feature = 1; + break; + case "BOUNDING_BOX": + case 2: + message.feature = 2; + break; + case "ORIENTED_BOUNDING_BOX": + case 6: + message.feature = 6; + break; + case "BOUNDING_POLY": + case 3: + message.feature = 3; + break; + case "POLYLINE": + case 4: + message.feature = 4; + break; + case "SEGMENTATION": + case 5: + message.feature = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a LabelImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelImageRequest} message LabelImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.basicConfig = null; + object.feature = options.enums === String ? "FEATURE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + if (message.feature != null && message.hasOwnProperty("feature")) + object.feature = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature[message.feature] === undefined ? message.feature : $root.google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature[message.feature] : message.feature; + if (message.imageClassificationConfig != null && message.hasOwnProperty("imageClassificationConfig")) { + object.imageClassificationConfig = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.toObject(message.imageClassificationConfig, options); + if (options.oneofs) + object.requestConfig = "imageClassificationConfig"; + } + if (message.boundingPolyConfig != null && message.hasOwnProperty("boundingPolyConfig")) { + object.boundingPolyConfig = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.toObject(message.boundingPolyConfig, options); + if (options.oneofs) + object.requestConfig = "boundingPolyConfig"; + } + if (message.polylineConfig != null && message.hasOwnProperty("polylineConfig")) { + object.polylineConfig = $root.google.cloud.datalabeling.v1beta1.PolylineConfig.toObject(message.polylineConfig, options); + if (options.oneofs) + object.requestConfig = "polylineConfig"; + } + if (message.segmentationConfig != null && message.hasOwnProperty("segmentationConfig")) { + object.segmentationConfig = $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.toObject(message.segmentationConfig, options); + if (options.oneofs) + object.requestConfig = "segmentationConfig"; + } + return object; + }; + + /** + * Converts this LabelImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @instance + * @returns {Object.} JSON object + */ + LabelImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelImageRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelImageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelImageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelImageRequest"; + }; + + /** + * Feature enum. + * @name google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature + * @enum {number} + * @property {number} FEATURE_UNSPECIFIED=0 FEATURE_UNSPECIFIED value + * @property {number} CLASSIFICATION=1 CLASSIFICATION value + * @property {number} BOUNDING_BOX=2 BOUNDING_BOX value + * @property {number} ORIENTED_BOUNDING_BOX=6 ORIENTED_BOUNDING_BOX value + * @property {number} BOUNDING_POLY=3 BOUNDING_POLY value + * @property {number} POLYLINE=4 POLYLINE value + * @property {number} SEGMENTATION=5 SEGMENTATION value + */ + LabelImageRequest.Feature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLASSIFICATION"] = 1; + values[valuesById[2] = "BOUNDING_BOX"] = 2; + values[valuesById[6] = "ORIENTED_BOUNDING_BOX"] = 6; + values[valuesById[3] = "BOUNDING_POLY"] = 3; + values[valuesById[4] = "POLYLINE"] = 4; + values[valuesById[5] = "SEGMENTATION"] = 5; + return values; + })(); + + return LabelImageRequest; + })(); + + v1beta1.LabelVideoRequest = (function() { + + /** + * Properties of a LabelVideoRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelVideoRequest + * @property {google.cloud.datalabeling.v1beta1.IVideoClassificationConfig|null} [videoClassificationConfig] LabelVideoRequest videoClassificationConfig + * @property {google.cloud.datalabeling.v1beta1.IObjectDetectionConfig|null} [objectDetectionConfig] LabelVideoRequest objectDetectionConfig + * @property {google.cloud.datalabeling.v1beta1.IObjectTrackingConfig|null} [objectTrackingConfig] LabelVideoRequest objectTrackingConfig + * @property {google.cloud.datalabeling.v1beta1.IEventConfig|null} [eventConfig] LabelVideoRequest eventConfig + * @property {string|null} [parent] LabelVideoRequest parent + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelVideoRequest basicConfig + * @property {google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature|null} [feature] LabelVideoRequest feature + */ + + /** + * Constructs a new LabelVideoRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelVideoRequest. + * @implements ILabelVideoRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoRequest=} [properties] Properties to set + */ + function LabelVideoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelVideoRequest videoClassificationConfig. + * @member {google.cloud.datalabeling.v1beta1.IVideoClassificationConfig|null|undefined} videoClassificationConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @instance + */ + LabelVideoRequest.prototype.videoClassificationConfig = null; + + /** + * LabelVideoRequest objectDetectionConfig. + * @member {google.cloud.datalabeling.v1beta1.IObjectDetectionConfig|null|undefined} objectDetectionConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @instance + */ + LabelVideoRequest.prototype.objectDetectionConfig = null; + + /** + * LabelVideoRequest objectTrackingConfig. + * @member {google.cloud.datalabeling.v1beta1.IObjectTrackingConfig|null|undefined} objectTrackingConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @instance + */ + LabelVideoRequest.prototype.objectTrackingConfig = null; + + /** + * LabelVideoRequest eventConfig. + * @member {google.cloud.datalabeling.v1beta1.IEventConfig|null|undefined} eventConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @instance + */ + LabelVideoRequest.prototype.eventConfig = null; + + /** + * LabelVideoRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @instance + */ + LabelVideoRequest.prototype.parent = ""; + + /** + * LabelVideoRequest basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @instance + */ + LabelVideoRequest.prototype.basicConfig = null; + + /** + * LabelVideoRequest feature. + * @member {google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature} feature + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @instance + */ + LabelVideoRequest.prototype.feature = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LabelVideoRequest requestConfig. + * @member {"videoClassificationConfig"|"objectDetectionConfig"|"objectTrackingConfig"|"eventConfig"|undefined} requestConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @instance + */ + Object.defineProperty(LabelVideoRequest.prototype, "requestConfig", { + get: $util.oneOfGetter($oneOfFields = ["videoClassificationConfig", "objectDetectionConfig", "objectTrackingConfig", "eventConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LabelVideoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoRequest} LabelVideoRequest instance + */ + LabelVideoRequest.create = function create(properties) { + return new LabelVideoRequest(properties); + }; + + /** + * Encodes the specified LabelVideoRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoRequest} message LabelVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.feature != null && Object.hasOwnProperty.call(message, "feature")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.feature); + if (message.videoClassificationConfig != null && Object.hasOwnProperty.call(message, "videoClassificationConfig")) + $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.encode(message.videoClassificationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.objectDetectionConfig != null && Object.hasOwnProperty.call(message, "objectDetectionConfig")) + $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.encode(message.objectDetectionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.objectTrackingConfig != null && Object.hasOwnProperty.call(message, "objectTrackingConfig")) + $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.encode(message.objectTrackingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.eventConfig != null && Object.hasOwnProperty.call(message, "eventConfig")) + $root.google.cloud.datalabeling.v1beta1.EventConfig.encode(message.eventConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelVideoRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoRequest} message LabelVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelVideoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoRequest} LabelVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.videoClassificationConfig = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.objectDetectionConfig = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.objectTrackingConfig = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.eventConfig = $root.google.cloud.datalabeling.v1beta1.EventConfig.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.feature = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelVideoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoRequest} LabelVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelVideoRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelVideoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.videoClassificationConfig != null && message.hasOwnProperty("videoClassificationConfig")) { + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.verify(message.videoClassificationConfig); + if (error) + return "videoClassificationConfig." + error; + } + } + if (message.objectDetectionConfig != null && message.hasOwnProperty("objectDetectionConfig")) { + if (properties.requestConfig === 1) + return "requestConfig: multiple values"; + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.verify(message.objectDetectionConfig); + if (error) + return "objectDetectionConfig." + error; + } + } + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) { + if (properties.requestConfig === 1) + return "requestConfig: multiple values"; + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.verify(message.objectTrackingConfig); + if (error) + return "objectTrackingConfig." + error; + } + } + if (message.eventConfig != null && message.hasOwnProperty("eventConfig")) { + if (properties.requestConfig === 1) + return "requestConfig: multiple values"; + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.EventConfig.verify(message.eventConfig); + if (error) + return "eventConfig." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + 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: + break; + } + return null; + }; + + /** + * Creates a LabelVideoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoRequest} LabelVideoRequest + */ + LabelVideoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelVideoRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoRequest(); + if (object.videoClassificationConfig != null) { + if (typeof object.videoClassificationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelVideoRequest.videoClassificationConfig: object expected"); + message.videoClassificationConfig = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.fromObject(object.videoClassificationConfig); + } + if (object.objectDetectionConfig != null) { + if (typeof object.objectDetectionConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelVideoRequest.objectDetectionConfig: object expected"); + message.objectDetectionConfig = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.fromObject(object.objectDetectionConfig); + } + if (object.objectTrackingConfig != null) { + if (typeof object.objectTrackingConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelVideoRequest.objectTrackingConfig: object expected"); + message.objectTrackingConfig = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.fromObject(object.objectTrackingConfig); + } + if (object.eventConfig != null) { + if (typeof object.eventConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelVideoRequest.eventConfig: object expected"); + message.eventConfig = $root.google.cloud.datalabeling.v1beta1.EventConfig.fromObject(object.eventConfig); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelVideoRequest.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + 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 "CLASSIFICATION": + case 1: + message.feature = 1; + break; + case "OBJECT_DETECTION": + case 2: + message.feature = 2; + break; + case "OBJECT_TRACKING": + case 3: + message.feature = 3; + break; + case "EVENT": + case 4: + message.feature = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a LabelVideoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelVideoRequest} message LabelVideoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelVideoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.basicConfig = null; + object.feature = options.enums === String ? "FEATURE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + if (message.feature != null && message.hasOwnProperty("feature")) + object.feature = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature[message.feature] === undefined ? message.feature : $root.google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature[message.feature] : message.feature; + if (message.videoClassificationConfig != null && message.hasOwnProperty("videoClassificationConfig")) { + object.videoClassificationConfig = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.toObject(message.videoClassificationConfig, options); + if (options.oneofs) + object.requestConfig = "videoClassificationConfig"; + } + if (message.objectDetectionConfig != null && message.hasOwnProperty("objectDetectionConfig")) { + object.objectDetectionConfig = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.toObject(message.objectDetectionConfig, options); + if (options.oneofs) + object.requestConfig = "objectDetectionConfig"; + } + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) { + object.objectTrackingConfig = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.toObject(message.objectTrackingConfig, options); + if (options.oneofs) + object.requestConfig = "objectTrackingConfig"; + } + if (message.eventConfig != null && message.hasOwnProperty("eventConfig")) { + object.eventConfig = $root.google.cloud.datalabeling.v1beta1.EventConfig.toObject(message.eventConfig, options); + if (options.oneofs) + object.requestConfig = "eventConfig"; + } + return object; + }; + + /** + * Converts this LabelVideoRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @instance + * @returns {Object.} JSON object + */ + LabelVideoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelVideoRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelVideoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelVideoRequest"; + }; + + /** + * Feature enum. + * @name google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature + * @enum {number} + * @property {number} FEATURE_UNSPECIFIED=0 FEATURE_UNSPECIFIED value + * @property {number} CLASSIFICATION=1 CLASSIFICATION value + * @property {number} OBJECT_DETECTION=2 OBJECT_DETECTION value + * @property {number} OBJECT_TRACKING=3 OBJECT_TRACKING value + * @property {number} EVENT=4 EVENT value + */ + LabelVideoRequest.Feature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLASSIFICATION"] = 1; + values[valuesById[2] = "OBJECT_DETECTION"] = 2; + values[valuesById[3] = "OBJECT_TRACKING"] = 3; + values[valuesById[4] = "EVENT"] = 4; + return values; + })(); + + return LabelVideoRequest; + })(); + + v1beta1.LabelTextRequest = (function() { + + /** + * Properties of a LabelTextRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelTextRequest + * @property {google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null} [textClassificationConfig] LabelTextRequest textClassificationConfig + * @property {google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig|null} [textEntityExtractionConfig] LabelTextRequest textEntityExtractionConfig + * @property {string|null} [parent] LabelTextRequest parent + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelTextRequest basicConfig + * @property {google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature|null} [feature] LabelTextRequest feature + */ + + /** + * Constructs a new LabelTextRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelTextRequest. + * @implements ILabelTextRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelTextRequest=} [properties] Properties to set + */ + function LabelTextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelTextRequest textClassificationConfig. + * @member {google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null|undefined} textClassificationConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @instance + */ + LabelTextRequest.prototype.textClassificationConfig = null; + + /** + * LabelTextRequest textEntityExtractionConfig. + * @member {google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig|null|undefined} textEntityExtractionConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @instance + */ + LabelTextRequest.prototype.textEntityExtractionConfig = null; + + /** + * LabelTextRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @instance + */ + LabelTextRequest.prototype.parent = ""; + + /** + * LabelTextRequest basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @instance + */ + LabelTextRequest.prototype.basicConfig = null; + + /** + * LabelTextRequest feature. + * @member {google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature} feature + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @instance + */ + LabelTextRequest.prototype.feature = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LabelTextRequest requestConfig. + * @member {"textClassificationConfig"|"textEntityExtractionConfig"|undefined} requestConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @instance + */ + Object.defineProperty(LabelTextRequest.prototype, "requestConfig", { + get: $util.oneOfGetter($oneOfFields = ["textClassificationConfig", "textEntityExtractionConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LabelTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelTextRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelTextRequest} LabelTextRequest instance + */ + LabelTextRequest.create = function create(properties) { + return new LabelTextRequest(properties); + }; + + /** + * Encodes the specified LabelTextRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelTextRequest} message LabelTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.textClassificationConfig != null && Object.hasOwnProperty.call(message, "textClassificationConfig")) + $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.encode(message.textClassificationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.textEntityExtractionConfig != null && Object.hasOwnProperty.call(message, "textEntityExtractionConfig")) + $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.encode(message.textEntityExtractionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.feature != null && Object.hasOwnProperty.call(message, "feature")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.feature); + return writer; + }; + + /** + * Encodes the specified LabelTextRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelTextRequest} message LabelTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelTextRequest} LabelTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.textClassificationConfig = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.textEntityExtractionConfig = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.feature = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelTextRequest} LabelTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelTextRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textClassificationConfig != null && message.hasOwnProperty("textClassificationConfig")) { + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.verify(message.textClassificationConfig); + if (error) + return "textClassificationConfig." + error; + } + } + if (message.textEntityExtractionConfig != null && message.hasOwnProperty("textEntityExtractionConfig")) { + if (properties.requestConfig === 1) + return "requestConfig: multiple values"; + properties.requestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.verify(message.textEntityExtractionConfig); + if (error) + return "textEntityExtractionConfig." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + if (message.feature != null && message.hasOwnProperty("feature")) + switch (message.feature) { + default: + return "feature: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a LabelTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelTextRequest} LabelTextRequest + */ + LabelTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelTextRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelTextRequest(); + if (object.textClassificationConfig != null) { + if (typeof object.textClassificationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelTextRequest.textClassificationConfig: object expected"); + message.textClassificationConfig = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.fromObject(object.textClassificationConfig); + } + if (object.textEntityExtractionConfig != null) { + if (typeof object.textEntityExtractionConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelTextRequest.textEntityExtractionConfig: object expected"); + message.textEntityExtractionConfig = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.fromObject(object.textEntityExtractionConfig); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelTextRequest.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + 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 "TEXT_CLASSIFICATION": + case 1: + message.feature = 1; + break; + case "TEXT_ENTITY_EXTRACTION": + case 2: + message.feature = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a LabelTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelTextRequest} message LabelTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.basicConfig = null; + object.feature = options.enums === String ? "FEATURE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + if (message.textClassificationConfig != null && message.hasOwnProperty("textClassificationConfig")) { + object.textClassificationConfig = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.toObject(message.textClassificationConfig, options); + if (options.oneofs) + object.requestConfig = "textClassificationConfig"; + } + if (message.textEntityExtractionConfig != null && message.hasOwnProperty("textEntityExtractionConfig")) { + object.textEntityExtractionConfig = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.toObject(message.textEntityExtractionConfig, options); + if (options.oneofs) + object.requestConfig = "textEntityExtractionConfig"; + } + if (message.feature != null && message.hasOwnProperty("feature")) + object.feature = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature[message.feature] === undefined ? message.feature : $root.google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature[message.feature] : message.feature; + return object; + }; + + /** + * Converts this LabelTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @instance + * @returns {Object.} JSON object + */ + LabelTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelTextRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelTextRequest"; + }; + + /** + * Feature enum. + * @name google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature + * @enum {number} + * @property {number} FEATURE_UNSPECIFIED=0 FEATURE_UNSPECIFIED value + * @property {number} TEXT_CLASSIFICATION=1 TEXT_CLASSIFICATION value + * @property {number} TEXT_ENTITY_EXTRACTION=2 TEXT_ENTITY_EXTRACTION value + */ + LabelTextRequest.Feature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT_CLASSIFICATION"] = 1; + values[valuesById[2] = "TEXT_ENTITY_EXTRACTION"] = 2; + return values; + })(); + + return LabelTextRequest; + })(); + + v1beta1.GetExampleRequest = (function() { + + /** + * Properties of a GetExampleRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGetExampleRequest + * @property {string|null} [name] GetExampleRequest name + * @property {string|null} [filter] GetExampleRequest filter + */ + + /** + * Constructs a new GetExampleRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GetExampleRequest. + * @implements IGetExampleRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGetExampleRequest=} [properties] Properties to set + */ + function GetExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExampleRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @instance + */ + GetExampleRequest.prototype.name = ""; + + /** + * GetExampleRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @instance + */ + GetExampleRequest.prototype.filter = ""; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetExampleRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GetExampleRequest} GetExampleRequest instance + */ + GetExampleRequest.create = function create(properties) { + return new GetExampleRequest(properties); + }; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + return writer; + }; + + /** + * Encodes the specified GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GetExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExampleRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExampleRequest.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"; + return null; + }; + + /** + * Creates a GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GetExampleRequest} GetExampleRequest + */ + GetExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GetExampleRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GetExampleRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.GetExampleRequest} message GetExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.filter = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this GetExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @instance + * @returns {Object.} JSON object + */ + GetExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExampleRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GetExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GetExampleRequest"; + }; + + return GetExampleRequest; + })(); + + v1beta1.ListExamplesRequest = (function() { + + /** + * Properties of a ListExamplesRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListExamplesRequest + * @property {string|null} [parent] ListExamplesRequest parent + * @property {string|null} [filter] ListExamplesRequest filter + * @property {number|null} [pageSize] ListExamplesRequest pageSize + * @property {string|null} [pageToken] ListExamplesRequest pageToken + */ + + /** + * Constructs a new ListExamplesRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListExamplesRequest. + * @implements IListExamplesRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListExamplesRequest=} [properties] Properties to set + */ + function ListExamplesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.parent = ""; + + /** + * ListExamplesRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.filter = ""; + + /** + * ListExamplesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageSize = 0; + + /** + * ListExamplesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListExamplesRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListExamplesRequest} ListExamplesRequest instance + */ + ListExamplesRequest.create = function create(properties) { + return new ListExamplesRequest(properties); + }; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListExamplesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListExamplesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListExamplesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListExamplesRequest} ListExamplesRequest + */ + ListExamplesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListExamplesRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListExamplesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListExamplesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ListExamplesRequest} message ListExamplesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListExamplesRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @instance + * @returns {Object.} JSON object + */ + ListExamplesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListExamplesRequest"; + }; + + return ListExamplesRequest; + })(); + + v1beta1.ListExamplesResponse = (function() { + + /** + * Properties of a ListExamplesResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListExamplesResponse + * @property {Array.|null} [examples] ListExamplesResponse examples + * @property {string|null} [nextPageToken] ListExamplesResponse nextPageToken + */ + + /** + * Constructs a new ListExamplesResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListExamplesResponse. + * @implements IListExamplesResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListExamplesResponse=} [properties] Properties to set + */ + function ListExamplesResponse(properties) { + this.examples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesResponse examples. + * @member {Array.} examples + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.examples = $util.emptyArray; + + /** + * ListExamplesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListExamplesResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListExamplesResponse} ListExamplesResponse instance + */ + ListExamplesResponse.create = function create(properties) { + return new ListExamplesResponse(properties); + }; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListExamplesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.datalabeling.v1beta1.Example.encode(message.examples[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 ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListExamplesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListExamplesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.datalabeling.v1beta1.Example.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.Example.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListExamplesResponse} ListExamplesResponse + */ + ListExamplesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListExamplesResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListExamplesResponse(); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ListExamplesResponse.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ListExamplesResponse.examples: object expected"); + message.examples[i] = $root.google.cloud.datalabeling.v1beta1.Example.fromObject(object.examples[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ListExamplesResponse} message ListExamplesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.examples = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.datalabeling.v1beta1.Example.toObject(message.examples[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExamplesResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @instance + * @returns {Object.} JSON object + */ + ListExamplesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListExamplesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListExamplesResponse"; + }; + + return ListExamplesResponse; + })(); + + v1beta1.CreateAnnotationSpecSetRequest = (function() { + + /** + * Properties of a CreateAnnotationSpecSetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ICreateAnnotationSpecSetRequest + * @property {string|null} [parent] CreateAnnotationSpecSetRequest parent + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpecSet|null} [annotationSpecSet] CreateAnnotationSpecSetRequest annotationSpecSet + */ + + /** + * Constructs a new CreateAnnotationSpecSetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a CreateAnnotationSpecSetRequest. + * @implements ICreateAnnotationSpecSetRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest=} [properties] Properties to set + */ + function CreateAnnotationSpecSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAnnotationSpecSetRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @instance + */ + CreateAnnotationSpecSetRequest.prototype.parent = ""; + + /** + * CreateAnnotationSpecSetRequest annotationSpecSet. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpecSet|null|undefined} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @instance + */ + CreateAnnotationSpecSetRequest.prototype.annotationSpecSet = null; + + /** + * Creates a new CreateAnnotationSpecSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest} CreateAnnotationSpecSetRequest instance + */ + CreateAnnotationSpecSetRequest.create = function create(properties) { + return new CreateAnnotationSpecSetRequest(properties); + }; + + /** + * Encodes the specified CreateAnnotationSpecSetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest} message CreateAnnotationSpecSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnnotationSpecSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.encode(message.annotationSpecSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAnnotationSpecSetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest} message CreateAnnotationSpecSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnnotationSpecSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAnnotationSpecSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest} CreateAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnnotationSpecSetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.annotationSpecSet = $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAnnotationSpecSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest} CreateAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnnotationSpecSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAnnotationSpecSetRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAnnotationSpecSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.verify(message.annotationSpecSet); + if (error) + return "annotationSpecSet." + error; + } + return null; + }; + + /** + * Creates a CreateAnnotationSpecSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest} CreateAnnotationSpecSetRequest + */ + CreateAnnotationSpecSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.annotationSpecSet != null) { + if (typeof object.annotationSpecSet !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest.annotationSpecSet: object expected"); + message.annotationSpecSet = $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.fromObject(object.annotationSpecSet); + } + return message; + }; + + /** + * Creates a plain object from a CreateAnnotationSpecSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest} message CreateAnnotationSpecSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAnnotationSpecSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.annotationSpecSet = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.toObject(message.annotationSpecSet, options); + return object; + }; + + /** + * Converts this CreateAnnotationSpecSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAnnotationSpecSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAnnotationSpecSetRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAnnotationSpecSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest"; + }; + + return CreateAnnotationSpecSetRequest; + })(); + + v1beta1.GetAnnotationSpecSetRequest = (function() { + + /** + * Properties of a GetAnnotationSpecSetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGetAnnotationSpecSetRequest + * @property {string|null} [name] GetAnnotationSpecSetRequest name + */ + + /** + * Constructs a new GetAnnotationSpecSetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GetAnnotationSpecSetRequest. + * @implements IGetAnnotationSpecSetRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest=} [properties] Properties to set + */ + function GetAnnotationSpecSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnnotationSpecSetRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @instance + */ + GetAnnotationSpecSetRequest.prototype.name = ""; + + /** + * Creates a new GetAnnotationSpecSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest} GetAnnotationSpecSetRequest instance + */ + GetAnnotationSpecSetRequest.create = function create(properties) { + return new GetAnnotationSpecSetRequest(properties); + }; + + /** + * Encodes the specified GetAnnotationSpecSetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest} message GetAnnotationSpecSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecSetRequest.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 GetAnnotationSpecSetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest} message GetAnnotationSpecSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnnotationSpecSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest} GetAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecSetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest(); + 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 GetAnnotationSpecSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest} GetAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnnotationSpecSetRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnnotationSpecSetRequest.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 GetAnnotationSpecSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest} GetAnnotationSpecSetRequest + */ + GetAnnotationSpecSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnnotationSpecSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest} message GetAnnotationSpecSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnnotationSpecSetRequest.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 GetAnnotationSpecSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnnotationSpecSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnnotationSpecSetRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnnotationSpecSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest"; + }; + + return GetAnnotationSpecSetRequest; + })(); + + v1beta1.ListAnnotationSpecSetsRequest = (function() { + + /** + * Properties of a ListAnnotationSpecSetsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListAnnotationSpecSetsRequest + * @property {string|null} [parent] ListAnnotationSpecSetsRequest parent + * @property {string|null} [filter] ListAnnotationSpecSetsRequest filter + * @property {number|null} [pageSize] ListAnnotationSpecSetsRequest pageSize + * @property {string|null} [pageToken] ListAnnotationSpecSetsRequest pageToken + */ + + /** + * Constructs a new ListAnnotationSpecSetsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListAnnotationSpecSetsRequest. + * @implements IListAnnotationSpecSetsRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest=} [properties] Properties to set + */ + function ListAnnotationSpecSetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnnotationSpecSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @instance + */ + ListAnnotationSpecSetsRequest.prototype.parent = ""; + + /** + * ListAnnotationSpecSetsRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @instance + */ + ListAnnotationSpecSetsRequest.prototype.filter = ""; + + /** + * ListAnnotationSpecSetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @instance + */ + ListAnnotationSpecSetsRequest.prototype.pageSize = 0; + + /** + * ListAnnotationSpecSetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @instance + */ + ListAnnotationSpecSetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAnnotationSpecSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest} ListAnnotationSpecSetsRequest instance + */ + ListAnnotationSpecSetsRequest.create = function create(properties) { + return new ListAnnotationSpecSetsRequest(properties); + }; + + /** + * Encodes the specified ListAnnotationSpecSetsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest} message ListAnnotationSpecSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotationSpecSetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAnnotationSpecSetsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest} message ListAnnotationSpecSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotationSpecSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnnotationSpecSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest} ListAnnotationSpecSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotationSpecSetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnnotationSpecSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest} ListAnnotationSpecSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotationSpecSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnnotationSpecSetsRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnnotationSpecSetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 ListAnnotationSpecSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest} ListAnnotationSpecSetsRequest + */ + ListAnnotationSpecSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListAnnotationSpecSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest} message ListAnnotationSpecSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnnotationSpecSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListAnnotationSpecSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAnnotationSpecSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnnotationSpecSetsRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnnotationSpecSetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest"; + }; + + return ListAnnotationSpecSetsRequest; + })(); + + v1beta1.ListAnnotationSpecSetsResponse = (function() { + + /** + * Properties of a ListAnnotationSpecSetsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListAnnotationSpecSetsResponse + * @property {Array.|null} [annotationSpecSets] ListAnnotationSpecSetsResponse annotationSpecSets + * @property {string|null} [nextPageToken] ListAnnotationSpecSetsResponse nextPageToken + */ + + /** + * Constructs a new ListAnnotationSpecSetsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListAnnotationSpecSetsResponse. + * @implements IListAnnotationSpecSetsResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse=} [properties] Properties to set + */ + function ListAnnotationSpecSetsResponse(properties) { + this.annotationSpecSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnnotationSpecSetsResponse annotationSpecSets. + * @member {Array.} annotationSpecSets + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @instance + */ + ListAnnotationSpecSetsResponse.prototype.annotationSpecSets = $util.emptyArray; + + /** + * ListAnnotationSpecSetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @instance + */ + ListAnnotationSpecSetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAnnotationSpecSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse} ListAnnotationSpecSetsResponse instance + */ + ListAnnotationSpecSetsResponse.create = function create(properties) { + return new ListAnnotationSpecSetsResponse(properties); + }; + + /** + * Encodes the specified ListAnnotationSpecSetsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse} message ListAnnotationSpecSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotationSpecSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSets != null && message.annotationSpecSets.length) + for (var i = 0; i < message.annotationSpecSets.length; ++i) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.encode(message.annotationSpecSets[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 ListAnnotationSpecSetsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse} message ListAnnotationSpecSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotationSpecSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnnotationSpecSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse} ListAnnotationSpecSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotationSpecSetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationSpecSets && message.annotationSpecSets.length)) + message.annotationSpecSets = []; + message.annotationSpecSets.push($root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnnotationSpecSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse} ListAnnotationSpecSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotationSpecSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnnotationSpecSetsResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnnotationSpecSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSets != null && message.hasOwnProperty("annotationSpecSets")) { + if (!Array.isArray(message.annotationSpecSets)) + return "annotationSpecSets: array expected"; + for (var i = 0; i < message.annotationSpecSets.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.verify(message.annotationSpecSets[i]); + if (error) + return "annotationSpecSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAnnotationSpecSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse} ListAnnotationSpecSetsResponse + */ + ListAnnotationSpecSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse(); + if (object.annotationSpecSets) { + if (!Array.isArray(object.annotationSpecSets)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.annotationSpecSets: array expected"); + message.annotationSpecSets = []; + for (var i = 0; i < object.annotationSpecSets.length; ++i) { + if (typeof object.annotationSpecSets[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.annotationSpecSets: object expected"); + message.annotationSpecSets[i] = $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.fromObject(object.annotationSpecSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAnnotationSpecSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse} message ListAnnotationSpecSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnnotationSpecSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationSpecSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.annotationSpecSets && message.annotationSpecSets.length) { + object.annotationSpecSets = []; + for (var j = 0; j < message.annotationSpecSets.length; ++j) + object.annotationSpecSets[j] = $root.google.cloud.datalabeling.v1beta1.AnnotationSpecSet.toObject(message.annotationSpecSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAnnotationSpecSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAnnotationSpecSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnnotationSpecSetsResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnnotationSpecSetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse"; + }; + + return ListAnnotationSpecSetsResponse; + })(); + + v1beta1.DeleteAnnotationSpecSetRequest = (function() { + + /** + * Properties of a DeleteAnnotationSpecSetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IDeleteAnnotationSpecSetRequest + * @property {string|null} [name] DeleteAnnotationSpecSetRequest name + */ + + /** + * Constructs a new DeleteAnnotationSpecSetRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a DeleteAnnotationSpecSetRequest. + * @implements IDeleteAnnotationSpecSetRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest=} [properties] Properties to set + */ + function DeleteAnnotationSpecSetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAnnotationSpecSetRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @instance + */ + DeleteAnnotationSpecSetRequest.prototype.name = ""; + + /** + * Creates a new DeleteAnnotationSpecSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest} DeleteAnnotationSpecSetRequest instance + */ + DeleteAnnotationSpecSetRequest.create = function create(properties) { + return new DeleteAnnotationSpecSetRequest(properties); + }; + + /** + * Encodes the specified DeleteAnnotationSpecSetRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest} message DeleteAnnotationSpecSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAnnotationSpecSetRequest.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 DeleteAnnotationSpecSetRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest} message DeleteAnnotationSpecSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAnnotationSpecSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAnnotationSpecSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest} DeleteAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAnnotationSpecSetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest(); + 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 DeleteAnnotationSpecSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest} DeleteAnnotationSpecSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAnnotationSpecSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAnnotationSpecSetRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAnnotationSpecSetRequest.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 DeleteAnnotationSpecSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest} DeleteAnnotationSpecSetRequest + */ + DeleteAnnotationSpecSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAnnotationSpecSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest} message DeleteAnnotationSpecSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAnnotationSpecSetRequest.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 DeleteAnnotationSpecSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAnnotationSpecSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAnnotationSpecSetRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAnnotationSpecSetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest"; + }; + + return DeleteAnnotationSpecSetRequest; + })(); + + v1beta1.CreateInstructionRequest = (function() { + + /** + * Properties of a CreateInstructionRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ICreateInstructionRequest + * @property {string|null} [parent] CreateInstructionRequest parent + * @property {google.cloud.datalabeling.v1beta1.IInstruction|null} [instruction] CreateInstructionRequest instruction + */ + + /** + * Constructs a new CreateInstructionRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a CreateInstructionRequest. + * @implements ICreateInstructionRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionRequest=} [properties] Properties to set + */ + function CreateInstructionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstructionRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @instance + */ + CreateInstructionRequest.prototype.parent = ""; + + /** + * CreateInstructionRequest instruction. + * @member {google.cloud.datalabeling.v1beta1.IInstruction|null|undefined} instruction + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @instance + */ + CreateInstructionRequest.prototype.instruction = null; + + /** + * Creates a new CreateInstructionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.CreateInstructionRequest} CreateInstructionRequest instance + */ + CreateInstructionRequest.create = function create(properties) { + return new CreateInstructionRequest(properties); + }; + + /** + * Encodes the specified CreateInstructionRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateInstructionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionRequest} message CreateInstructionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstructionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + $root.google.cloud.datalabeling.v1beta1.Instruction.encode(message.instruction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstructionRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateInstructionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionRequest} message CreateInstructionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstructionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstructionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.CreateInstructionRequest} CreateInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstructionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.CreateInstructionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instruction = $root.google.cloud.datalabeling.v1beta1.Instruction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstructionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.CreateInstructionRequest} CreateInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstructionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstructionRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstructionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instruction != null && message.hasOwnProperty("instruction")) { + var error = $root.google.cloud.datalabeling.v1beta1.Instruction.verify(message.instruction); + if (error) + return "instruction." + error; + } + return null; + }; + + /** + * Creates a CreateInstructionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.CreateInstructionRequest} CreateInstructionRequest + */ + CreateInstructionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.CreateInstructionRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.CreateInstructionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instruction != null) { + if (typeof object.instruction !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.CreateInstructionRequest.instruction: object expected"); + message.instruction = $root.google.cloud.datalabeling.v1beta1.Instruction.fromObject(object.instruction); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstructionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.CreateInstructionRequest} message CreateInstructionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstructionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instruction = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = $root.google.cloud.datalabeling.v1beta1.Instruction.toObject(message.instruction, options); + return object; + }; + + /** + * Converts this CreateInstructionRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstructionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstructionRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstructionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.CreateInstructionRequest"; + }; + + return CreateInstructionRequest; + })(); + + v1beta1.GetInstructionRequest = (function() { + + /** + * Properties of a GetInstructionRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGetInstructionRequest + * @property {string|null} [name] GetInstructionRequest name + */ + + /** + * Constructs a new GetInstructionRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GetInstructionRequest. + * @implements IGetInstructionRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGetInstructionRequest=} [properties] Properties to set + */ + function GetInstructionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstructionRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @instance + */ + GetInstructionRequest.prototype.name = ""; + + /** + * Creates a new GetInstructionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetInstructionRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GetInstructionRequest} GetInstructionRequest instance + */ + GetInstructionRequest.create = function create(properties) { + return new GetInstructionRequest(properties); + }; + + /** + * Encodes the specified GetInstructionRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetInstructionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetInstructionRequest} message GetInstructionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstructionRequest.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 GetInstructionRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetInstructionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetInstructionRequest} message GetInstructionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstructionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstructionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GetInstructionRequest} GetInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstructionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GetInstructionRequest(); + 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 GetInstructionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GetInstructionRequest} GetInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstructionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstructionRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstructionRequest.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 GetInstructionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GetInstructionRequest} GetInstructionRequest + */ + GetInstructionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GetInstructionRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GetInstructionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstructionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.GetInstructionRequest} message GetInstructionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstructionRequest.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 GetInstructionRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstructionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstructionRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GetInstructionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstructionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GetInstructionRequest"; + }; + + return GetInstructionRequest; + })(); + + v1beta1.DeleteInstructionRequest = (function() { + + /** + * Properties of a DeleteInstructionRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IDeleteInstructionRequest + * @property {string|null} [name] DeleteInstructionRequest name + */ + + /** + * Constructs a new DeleteInstructionRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a DeleteInstructionRequest. + * @implements IDeleteInstructionRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest=} [properties] Properties to set + */ + function DeleteInstructionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstructionRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @instance + */ + DeleteInstructionRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstructionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.DeleteInstructionRequest} DeleteInstructionRequest instance + */ + DeleteInstructionRequest.create = function create(properties) { + return new DeleteInstructionRequest(properties); + }; + + /** + * Encodes the specified DeleteInstructionRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteInstructionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest} message DeleteInstructionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstructionRequest.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 DeleteInstructionRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteInstructionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest} message DeleteInstructionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstructionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstructionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.DeleteInstructionRequest} DeleteInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstructionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest(); + 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 DeleteInstructionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.DeleteInstructionRequest} DeleteInstructionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstructionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstructionRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstructionRequest.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 DeleteInstructionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.DeleteInstructionRequest} DeleteInstructionRequest + */ + DeleteInstructionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstructionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.DeleteInstructionRequest} message DeleteInstructionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstructionRequest.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 DeleteInstructionRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstructionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstructionRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.DeleteInstructionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstructionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.DeleteInstructionRequest"; + }; + + return DeleteInstructionRequest; + })(); + + v1beta1.ListInstructionsRequest = (function() { + + /** + * Properties of a ListInstructionsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListInstructionsRequest + * @property {string|null} [parent] ListInstructionsRequest parent + * @property {string|null} [filter] ListInstructionsRequest filter + * @property {number|null} [pageSize] ListInstructionsRequest pageSize + * @property {string|null} [pageToken] ListInstructionsRequest pageToken + */ + + /** + * Constructs a new ListInstructionsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListInstructionsRequest. + * @implements IListInstructionsRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsRequest=} [properties] Properties to set + */ + function ListInstructionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstructionsRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @instance + */ + ListInstructionsRequest.prototype.parent = ""; + + /** + * ListInstructionsRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @instance + */ + ListInstructionsRequest.prototype.filter = ""; + + /** + * ListInstructionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @instance + */ + ListInstructionsRequest.prototype.pageSize = 0; + + /** + * ListInstructionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @instance + */ + ListInstructionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstructionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListInstructionsRequest} ListInstructionsRequest instance + */ + ListInstructionsRequest.create = function create(properties) { + return new ListInstructionsRequest(properties); + }; + + /** + * Encodes the specified ListInstructionsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListInstructionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsRequest} message ListInstructionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstructionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListInstructionsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListInstructionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsRequest} message ListInstructionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstructionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstructionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListInstructionsRequest} ListInstructionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstructionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListInstructionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstructionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListInstructionsRequest} ListInstructionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstructionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstructionsRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstructionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 ListInstructionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListInstructionsRequest} ListInstructionsRequest + */ + ListInstructionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListInstructionsRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListInstructionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListInstructionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ListInstructionsRequest} message ListInstructionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstructionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListInstructionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstructionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstructionsRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstructionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListInstructionsRequest"; + }; + + return ListInstructionsRequest; + })(); + + v1beta1.ListInstructionsResponse = (function() { + + /** + * Properties of a ListInstructionsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListInstructionsResponse + * @property {Array.|null} [instructions] ListInstructionsResponse instructions + * @property {string|null} [nextPageToken] ListInstructionsResponse nextPageToken + */ + + /** + * Constructs a new ListInstructionsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListInstructionsResponse. + * @implements IListInstructionsResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsResponse=} [properties] Properties to set + */ + function ListInstructionsResponse(properties) { + this.instructions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstructionsResponse instructions. + * @member {Array.} instructions + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @instance + */ + ListInstructionsResponse.prototype.instructions = $util.emptyArray; + + /** + * ListInstructionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @instance + */ + ListInstructionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstructionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListInstructionsResponse} ListInstructionsResponse instance + */ + ListInstructionsResponse.create = function create(properties) { + return new ListInstructionsResponse(properties); + }; + + /** + * Encodes the specified ListInstructionsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListInstructionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsResponse} message ListInstructionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstructionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instructions != null && message.instructions.length) + for (var i = 0; i < message.instructions.length; ++i) + $root.google.cloud.datalabeling.v1beta1.Instruction.encode(message.instructions[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 ListInstructionsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListInstructionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListInstructionsResponse} message ListInstructionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstructionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstructionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListInstructionsResponse} ListInstructionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstructionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListInstructionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.instructions && message.instructions.length)) + message.instructions = []; + message.instructions.push($root.google.cloud.datalabeling.v1beta1.Instruction.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstructionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListInstructionsResponse} ListInstructionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstructionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstructionsResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstructionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instructions != null && message.hasOwnProperty("instructions")) { + if (!Array.isArray(message.instructions)) + return "instructions: array expected"; + for (var i = 0; i < message.instructions.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.Instruction.verify(message.instructions[i]); + if (error) + return "instructions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstructionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListInstructionsResponse} ListInstructionsResponse + */ + ListInstructionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListInstructionsResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListInstructionsResponse(); + if (object.instructions) { + if (!Array.isArray(object.instructions)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ListInstructionsResponse.instructions: array expected"); + message.instructions = []; + for (var i = 0; i < object.instructions.length; ++i) { + if (typeof object.instructions[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ListInstructionsResponse.instructions: object expected"); + message.instructions[i] = $root.google.cloud.datalabeling.v1beta1.Instruction.fromObject(object.instructions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstructionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ListInstructionsResponse} message ListInstructionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstructionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instructions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.instructions && message.instructions.length) { + object.instructions = []; + for (var j = 0; j < message.instructions.length; ++j) + object.instructions[j] = $root.google.cloud.datalabeling.v1beta1.Instruction.toObject(message.instructions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstructionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstructionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstructionsResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListInstructionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstructionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListInstructionsResponse"; + }; + + return ListInstructionsResponse; + })(); + + v1beta1.GetEvaluationRequest = (function() { + + /** + * Properties of a GetEvaluationRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGetEvaluationRequest + * @property {string|null} [name] GetEvaluationRequest name + */ + + /** + * Constructs a new GetEvaluationRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GetEvaluationRequest. + * @implements IGetEvaluationRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationRequest=} [properties] Properties to set + */ + function GetEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @instance + */ + GetEvaluationRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GetEvaluationRequest} GetEvaluationRequest instance + */ + GetEvaluationRequest.create = function create(properties) { + return new GetEvaluationRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.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 GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GetEvaluationRequest(); + 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 GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationRequest.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 GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GetEvaluationRequest} GetEvaluationRequest + */ + GetEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GetEvaluationRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GetEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.GetEvaluationRequest} message GetEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationRequest.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 GetEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GetEvaluationRequest"; + }; + + return GetEvaluationRequest; + })(); + + v1beta1.SearchEvaluationsRequest = (function() { + + /** + * Properties of a SearchEvaluationsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ISearchEvaluationsRequest + * @property {string|null} [parent] SearchEvaluationsRequest parent + * @property {string|null} [filter] SearchEvaluationsRequest filter + * @property {number|null} [pageSize] SearchEvaluationsRequest pageSize + * @property {string|null} [pageToken] SearchEvaluationsRequest pageToken + */ + + /** + * Constructs a new SearchEvaluationsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a SearchEvaluationsRequest. + * @implements ISearchEvaluationsRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest=} [properties] Properties to set + */ + function SearchEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @instance + */ + SearchEvaluationsRequest.prototype.parent = ""; + + /** + * SearchEvaluationsRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @instance + */ + SearchEvaluationsRequest.prototype.filter = ""; + + /** + * SearchEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @instance + */ + SearchEvaluationsRequest.prototype.pageSize = 0; + + /** + * SearchEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @instance + */ + SearchEvaluationsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest} SearchEvaluationsRequest instance + */ + SearchEvaluationsRequest.create = function create(properties) { + return new SearchEvaluationsRequest(properties); + }; + + /** + * Encodes the specified SearchEvaluationsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest} message SearchEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchEvaluationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified SearchEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest} message SearchEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest} SearchEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchEvaluationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest} SearchEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchEvaluationsRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchEvaluationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 SearchEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest} SearchEvaluationsRequest + */ + SearchEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 SearchEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest} message SearchEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchEvaluationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this SearchEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest"; + }; + + return SearchEvaluationsRequest; + })(); + + v1beta1.SearchEvaluationsResponse = (function() { + + /** + * Properties of a SearchEvaluationsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ISearchEvaluationsResponse + * @property {Array.|null} [evaluations] SearchEvaluationsResponse evaluations + * @property {string|null} [nextPageToken] SearchEvaluationsResponse nextPageToken + */ + + /** + * Constructs a new SearchEvaluationsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a SearchEvaluationsResponse. + * @implements ISearchEvaluationsResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse=} [properties] Properties to set + */ + function SearchEvaluationsResponse(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchEvaluationsResponse evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @instance + */ + SearchEvaluationsResponse.prototype.evaluations = $util.emptyArray; + + /** + * SearchEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @instance + */ + SearchEvaluationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse} SearchEvaluationsResponse instance + */ + SearchEvaluationsResponse.create = function create(properties) { + return new SearchEvaluationsResponse(properties); + }; + + /** + * Encodes the specified SearchEvaluationsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse} message SearchEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.datalabeling.v1beta1.Evaluation.encode(message.evaluations[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 SearchEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse} message SearchEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse} SearchEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchEvaluationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.datalabeling.v1beta1.Evaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse} SearchEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchEvaluationsResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse} SearchEvaluationsResponse + */ + SearchEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.datalabeling.v1beta1.Evaluation.fromObject(object.evaluations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse} message SearchEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.datalabeling.v1beta1.Evaluation.toObject(message.evaluations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse"; + }; + + return SearchEvaluationsResponse; + })(); + + v1beta1.SearchExampleComparisonsRequest = (function() { + + /** + * Properties of a SearchExampleComparisonsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ISearchExampleComparisonsRequest + * @property {string|null} [parent] SearchExampleComparisonsRequest parent + * @property {number|null} [pageSize] SearchExampleComparisonsRequest pageSize + * @property {string|null} [pageToken] SearchExampleComparisonsRequest pageToken + */ + + /** + * Constructs a new SearchExampleComparisonsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a SearchExampleComparisonsRequest. + * @implements ISearchExampleComparisonsRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest=} [properties] Properties to set + */ + function SearchExampleComparisonsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchExampleComparisonsRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @instance + */ + SearchExampleComparisonsRequest.prototype.parent = ""; + + /** + * SearchExampleComparisonsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @instance + */ + SearchExampleComparisonsRequest.prototype.pageSize = 0; + + /** + * SearchExampleComparisonsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @instance + */ + SearchExampleComparisonsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchExampleComparisonsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest} SearchExampleComparisonsRequest instance + */ + SearchExampleComparisonsRequest.create = function create(properties) { + return new SearchExampleComparisonsRequest(properties); + }; + + /** + * Encodes the specified SearchExampleComparisonsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest} message SearchExampleComparisonsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchExampleComparisonsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified SearchExampleComparisonsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest} message SearchExampleComparisonsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchExampleComparisonsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchExampleComparisonsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest} SearchExampleComparisonsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchExampleComparisonsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchExampleComparisonsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest} SearchExampleComparisonsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchExampleComparisonsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchExampleComparisonsRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchExampleComparisonsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a SearchExampleComparisonsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest} SearchExampleComparisonsRequest + */ + SearchExampleComparisonsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a SearchExampleComparisonsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest} message SearchExampleComparisonsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchExampleComparisonsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this SearchExampleComparisonsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchExampleComparisonsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchExampleComparisonsRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchExampleComparisonsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest"; + }; + + return SearchExampleComparisonsRequest; + })(); + + v1beta1.SearchExampleComparisonsResponse = (function() { + + /** + * Properties of a SearchExampleComparisonsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ISearchExampleComparisonsResponse + * @property {Array.|null} [exampleComparisons] SearchExampleComparisonsResponse exampleComparisons + * @property {string|null} [nextPageToken] SearchExampleComparisonsResponse nextPageToken + */ + + /** + * Constructs a new SearchExampleComparisonsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a SearchExampleComparisonsResponse. + * @implements ISearchExampleComparisonsResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse=} [properties] Properties to set + */ + function SearchExampleComparisonsResponse(properties) { + this.exampleComparisons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchExampleComparisonsResponse exampleComparisons. + * @member {Array.} exampleComparisons + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @instance + */ + SearchExampleComparisonsResponse.prototype.exampleComparisons = $util.emptyArray; + + /** + * SearchExampleComparisonsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @instance + */ + SearchExampleComparisonsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchExampleComparisonsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse} SearchExampleComparisonsResponse instance + */ + SearchExampleComparisonsResponse.create = function create(properties) { + return new SearchExampleComparisonsResponse(properties); + }; + + /** + * Encodes the specified SearchExampleComparisonsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse} message SearchExampleComparisonsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchExampleComparisonsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exampleComparisons != null && message.exampleComparisons.length) + for (var i = 0; i < message.exampleComparisons.length; ++i) + $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.encode(message.exampleComparisons[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 SearchExampleComparisonsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse} message SearchExampleComparisonsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchExampleComparisonsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchExampleComparisonsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse} SearchExampleComparisonsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchExampleComparisonsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.exampleComparisons && message.exampleComparisons.length)) + message.exampleComparisons = []; + message.exampleComparisons.push($root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchExampleComparisonsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse} SearchExampleComparisonsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchExampleComparisonsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchExampleComparisonsResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchExampleComparisonsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exampleComparisons != null && message.hasOwnProperty("exampleComparisons")) { + if (!Array.isArray(message.exampleComparisons)) + return "exampleComparisons: array expected"; + for (var i = 0; i < message.exampleComparisons.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.verify(message.exampleComparisons[i]); + if (error) + return "exampleComparisons." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchExampleComparisonsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse} SearchExampleComparisonsResponse + */ + SearchExampleComparisonsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse(); + if (object.exampleComparisons) { + if (!Array.isArray(object.exampleComparisons)) + throw TypeError(".google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.exampleComparisons: array expected"); + message.exampleComparisons = []; + for (var i = 0; i < object.exampleComparisons.length; ++i) { + if (typeof object.exampleComparisons[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.exampleComparisons: object expected"); + message.exampleComparisons[i] = $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.fromObject(object.exampleComparisons[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchExampleComparisonsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse} message SearchExampleComparisonsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchExampleComparisonsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exampleComparisons = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.exampleComparisons && message.exampleComparisons.length) { + object.exampleComparisons = []; + for (var j = 0; j < message.exampleComparisons.length; ++j) + object.exampleComparisons[j] = $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.toObject(message.exampleComparisons[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchExampleComparisonsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchExampleComparisonsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchExampleComparisonsResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchExampleComparisonsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse"; + }; + + SearchExampleComparisonsResponse.ExampleComparison = (function() { + + /** + * Properties of an ExampleComparison. + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @interface IExampleComparison + * @property {google.cloud.datalabeling.v1beta1.IExample|null} [groundTruthExample] ExampleComparison groundTruthExample + * @property {Array.|null} [modelCreatedExamples] ExampleComparison modelCreatedExamples + */ + + /** + * Constructs a new ExampleComparison. + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse + * @classdesc Represents an ExampleComparison. + * @implements IExampleComparison + * @constructor + * @param {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison=} [properties] Properties to set + */ + function ExampleComparison(properties) { + this.modelCreatedExamples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExampleComparison groundTruthExample. + * @member {google.cloud.datalabeling.v1beta1.IExample|null|undefined} groundTruthExample + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @instance + */ + ExampleComparison.prototype.groundTruthExample = null; + + /** + * ExampleComparison modelCreatedExamples. + * @member {Array.} modelCreatedExamples + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @instance + */ + ExampleComparison.prototype.modelCreatedExamples = $util.emptyArray; + + /** + * Creates a new ExampleComparison instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @static + * @param {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison} ExampleComparison instance + */ + ExampleComparison.create = function create(properties) { + return new ExampleComparison(properties); + }; + + /** + * Encodes the specified ExampleComparison message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @static + * @param {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison} message ExampleComparison message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExampleComparison.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groundTruthExample != null && Object.hasOwnProperty.call(message, "groundTruthExample")) + $root.google.cloud.datalabeling.v1beta1.Example.encode(message.groundTruthExample, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modelCreatedExamples != null && message.modelCreatedExamples.length) + for (var i = 0; i < message.modelCreatedExamples.length; ++i) + $root.google.cloud.datalabeling.v1beta1.Example.encode(message.modelCreatedExamples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExampleComparison message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @static + * @param {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison} message ExampleComparison message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExampleComparison.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExampleComparison message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison} ExampleComparison + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExampleComparison.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.groundTruthExample = $root.google.cloud.datalabeling.v1beta1.Example.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.modelCreatedExamples && message.modelCreatedExamples.length)) + message.modelCreatedExamples = []; + message.modelCreatedExamples.push($root.google.cloud.datalabeling.v1beta1.Example.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExampleComparison message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison} ExampleComparison + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExampleComparison.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExampleComparison message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExampleComparison.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groundTruthExample != null && message.hasOwnProperty("groundTruthExample")) { + var error = $root.google.cloud.datalabeling.v1beta1.Example.verify(message.groundTruthExample); + if (error) + return "groundTruthExample." + error; + } + if (message.modelCreatedExamples != null && message.hasOwnProperty("modelCreatedExamples")) { + if (!Array.isArray(message.modelCreatedExamples)) + return "modelCreatedExamples: array expected"; + for (var i = 0; i < message.modelCreatedExamples.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.Example.verify(message.modelCreatedExamples[i]); + if (error) + return "modelCreatedExamples." + error; + } + } + return null; + }; + + /** + * Creates an ExampleComparison message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison} ExampleComparison + */ + ExampleComparison.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison(); + if (object.groundTruthExample != null) { + if (typeof object.groundTruthExample !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.groundTruthExample: object expected"); + message.groundTruthExample = $root.google.cloud.datalabeling.v1beta1.Example.fromObject(object.groundTruthExample); + } + if (object.modelCreatedExamples) { + if (!Array.isArray(object.modelCreatedExamples)) + throw TypeError(".google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.modelCreatedExamples: array expected"); + message.modelCreatedExamples = []; + for (var i = 0; i < object.modelCreatedExamples.length; ++i) { + if (typeof object.modelCreatedExamples[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.modelCreatedExamples: object expected"); + message.modelCreatedExamples[i] = $root.google.cloud.datalabeling.v1beta1.Example.fromObject(object.modelCreatedExamples[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExampleComparison message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @static + * @param {google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison} message ExampleComparison + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExampleComparison.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modelCreatedExamples = []; + if (options.defaults) + object.groundTruthExample = null; + if (message.groundTruthExample != null && message.hasOwnProperty("groundTruthExample")) + object.groundTruthExample = $root.google.cloud.datalabeling.v1beta1.Example.toObject(message.groundTruthExample, options); + if (message.modelCreatedExamples && message.modelCreatedExamples.length) { + object.modelCreatedExamples = []; + for (var j = 0; j < message.modelCreatedExamples.length; ++j) + object.modelCreatedExamples[j] = $root.google.cloud.datalabeling.v1beta1.Example.toObject(message.modelCreatedExamples[j], options); + } + return object; + }; + + /** + * Converts this ExampleComparison to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @instance + * @returns {Object.} JSON object + */ + ExampleComparison.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExampleComparison + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExampleComparison.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison"; + }; + + return ExampleComparison; + })(); + + return SearchExampleComparisonsResponse; + })(); + + v1beta1.CreateEvaluationJobRequest = (function() { + + /** + * Properties of a CreateEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ICreateEvaluationJobRequest + * @property {string|null} [parent] CreateEvaluationJobRequest parent + * @property {google.cloud.datalabeling.v1beta1.IEvaluationJob|null} [job] CreateEvaluationJobRequest job + */ + + /** + * Constructs a new CreateEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a CreateEvaluationJobRequest. + * @implements ICreateEvaluationJobRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest=} [properties] Properties to set + */ + function CreateEvaluationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEvaluationJobRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @instance + */ + CreateEvaluationJobRequest.prototype.parent = ""; + + /** + * CreateEvaluationJobRequest job. + * @member {google.cloud.datalabeling.v1beta1.IEvaluationJob|null|undefined} job + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @instance + */ + CreateEvaluationJobRequest.prototype.job = null; + + /** + * Creates a new CreateEvaluationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest} CreateEvaluationJobRequest instance + */ + CreateEvaluationJobRequest.create = function create(properties) { + return new CreateEvaluationJobRequest(properties); + }; + + /** + * Encodes the specified CreateEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest} message CreateEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.datalabeling.v1beta1.EvaluationJob.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest} message CreateEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEvaluationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest} CreateEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.job = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest} CreateEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEvaluationJobRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEvaluationJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.verify(message.job); + if (error) + return "job." + error; + } + return null; + }; + + /** + * Creates a CreateEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest} CreateEvaluationJobRequest + */ + CreateEvaluationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest.job: object expected"); + message.job = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.fromObject(object.job); + } + return message; + }; + + /** + * Creates a plain object from a CreateEvaluationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest} message CreateEvaluationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEvaluationJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.job = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.toObject(message.job, options); + return object; + }; + + /** + * Converts this CreateEvaluationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEvaluationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEvaluationJobRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEvaluationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest"; + }; + + return CreateEvaluationJobRequest; + })(); + + v1beta1.UpdateEvaluationJobRequest = (function() { + + /** + * Properties of an UpdateEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IUpdateEvaluationJobRequest + * @property {google.cloud.datalabeling.v1beta1.IEvaluationJob|null} [evaluationJob] UpdateEvaluationJobRequest evaluationJob + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationJobRequest updateMask + */ + + /** + * Constructs a new UpdateEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an UpdateEvaluationJobRequest. + * @implements IUpdateEvaluationJobRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest=} [properties] Properties to set + */ + function UpdateEvaluationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEvaluationJobRequest evaluationJob. + * @member {google.cloud.datalabeling.v1beta1.IEvaluationJob|null|undefined} evaluationJob + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @instance + */ + UpdateEvaluationJobRequest.prototype.evaluationJob = null; + + /** + * UpdateEvaluationJobRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @instance + */ + UpdateEvaluationJobRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEvaluationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest} UpdateEvaluationJobRequest instance + */ + UpdateEvaluationJobRequest.create = function create(properties) { + return new UpdateEvaluationJobRequest(properties); + }; + + /** + * Encodes the specified UpdateEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest} message UpdateEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationJob != null && Object.hasOwnProperty.call(message, "evaluationJob")) + $root.google.cloud.datalabeling.v1beta1.EvaluationJob.encode(message.evaluationJob, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest} message UpdateEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEvaluationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest} UpdateEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.evaluationJob = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest} UpdateEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEvaluationJobRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEvaluationJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationJob != null && message.hasOwnProperty("evaluationJob")) { + var error = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.verify(message.evaluationJob); + if (error) + return "evaluationJob." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest} UpdateEvaluationJobRequest + */ + UpdateEvaluationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest(); + if (object.evaluationJob != null) { + if (typeof object.evaluationJob !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest.evaluationJob: object expected"); + message.evaluationJob = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.fromObject(object.evaluationJob); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEvaluationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest} message UpdateEvaluationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEvaluationJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.evaluationJob = null; + object.updateMask = null; + } + if (message.evaluationJob != null && message.hasOwnProperty("evaluationJob")) + object.evaluationJob = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.toObject(message.evaluationJob, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEvaluationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEvaluationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEvaluationJobRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEvaluationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest"; + }; + + return UpdateEvaluationJobRequest; + })(); + + v1beta1.GetEvaluationJobRequest = (function() { + + /** + * Properties of a GetEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGetEvaluationJobRequest + * @property {string|null} [name] GetEvaluationJobRequest name + */ + + /** + * Constructs a new GetEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GetEvaluationJobRequest. + * @implements IGetEvaluationJobRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest=} [properties] Properties to set + */ + function GetEvaluationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationJobRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @instance + */ + GetEvaluationJobRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest} GetEvaluationJobRequest instance + */ + GetEvaluationJobRequest.create = function create(properties) { + return new GetEvaluationJobRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest} message GetEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationJobRequest.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 GetEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest} message GetEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest} GetEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest(); + 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 GetEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest} GetEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationJobRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationJobRequest.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 GetEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest} GetEvaluationJobRequest + */ + GetEvaluationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest} message GetEvaluationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationJobRequest.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 GetEvaluationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationJobRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest"; + }; + + return GetEvaluationJobRequest; + })(); + + v1beta1.PauseEvaluationJobRequest = (function() { + + /** + * Properties of a PauseEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IPauseEvaluationJobRequest + * @property {string|null} [name] PauseEvaluationJobRequest name + */ + + /** + * Constructs a new PauseEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a PauseEvaluationJobRequest. + * @implements IPauseEvaluationJobRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest=} [properties] Properties to set + */ + function PauseEvaluationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PauseEvaluationJobRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @instance + */ + PauseEvaluationJobRequest.prototype.name = ""; + + /** + * Creates a new PauseEvaluationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest} PauseEvaluationJobRequest instance + */ + PauseEvaluationJobRequest.create = function create(properties) { + return new PauseEvaluationJobRequest(properties); + }; + + /** + * Encodes the specified PauseEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest} message PauseEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseEvaluationJobRequest.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 PauseEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest} message PauseEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseEvaluationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PauseEvaluationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest} PauseEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseEvaluationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest(); + 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 PauseEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest} PauseEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseEvaluationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PauseEvaluationJobRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PauseEvaluationJobRequest.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 PauseEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest} PauseEvaluationJobRequest + */ + PauseEvaluationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PauseEvaluationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest} message PauseEvaluationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PauseEvaluationJobRequest.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 PauseEvaluationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @instance + * @returns {Object.} JSON object + */ + PauseEvaluationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PauseEvaluationJobRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PauseEvaluationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest"; + }; + + return PauseEvaluationJobRequest; + })(); + + v1beta1.ResumeEvaluationJobRequest = (function() { + + /** + * Properties of a ResumeEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IResumeEvaluationJobRequest + * @property {string|null} [name] ResumeEvaluationJobRequest name + */ + + /** + * Constructs a new ResumeEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ResumeEvaluationJobRequest. + * @implements IResumeEvaluationJobRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest=} [properties] Properties to set + */ + function ResumeEvaluationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResumeEvaluationJobRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @instance + */ + ResumeEvaluationJobRequest.prototype.name = ""; + + /** + * Creates a new ResumeEvaluationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest} ResumeEvaluationJobRequest instance + */ + ResumeEvaluationJobRequest.create = function create(properties) { + return new ResumeEvaluationJobRequest(properties); + }; + + /** + * Encodes the specified ResumeEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest} message ResumeEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeEvaluationJobRequest.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 ResumeEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest} message ResumeEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeEvaluationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumeEvaluationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest} ResumeEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeEvaluationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest(); + 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 ResumeEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest} ResumeEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeEvaluationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumeEvaluationJobRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumeEvaluationJobRequest.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 ResumeEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest} ResumeEvaluationJobRequest + */ + ResumeEvaluationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ResumeEvaluationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest} message ResumeEvaluationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumeEvaluationJobRequest.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 ResumeEvaluationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @instance + * @returns {Object.} JSON object + */ + ResumeEvaluationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumeEvaluationJobRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumeEvaluationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest"; + }; + + return ResumeEvaluationJobRequest; + })(); + + v1beta1.DeleteEvaluationJobRequest = (function() { + + /** + * Properties of a DeleteEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IDeleteEvaluationJobRequest + * @property {string|null} [name] DeleteEvaluationJobRequest name + */ + + /** + * Constructs a new DeleteEvaluationJobRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a DeleteEvaluationJobRequest. + * @implements IDeleteEvaluationJobRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest=} [properties] Properties to set + */ + function DeleteEvaluationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationJobRequest name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @instance + */ + DeleteEvaluationJobRequest.prototype.name = ""; + + /** + * Creates a new DeleteEvaluationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest} DeleteEvaluationJobRequest instance + */ + DeleteEvaluationJobRequest.create = function create(properties) { + return new DeleteEvaluationJobRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationJobRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest} message DeleteEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationJobRequest.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 DeleteEvaluationJobRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest} message DeleteEvaluationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest} DeleteEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest(); + 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 DeleteEvaluationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest} DeleteEvaluationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationJobRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationJobRequest.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 DeleteEvaluationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest} DeleteEvaluationJobRequest + */ + DeleteEvaluationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest} message DeleteEvaluationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationJobRequest.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 DeleteEvaluationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationJobRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest"; + }; + + return DeleteEvaluationJobRequest; + })(); + + v1beta1.ListEvaluationJobsRequest = (function() { + + /** + * Properties of a ListEvaluationJobsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListEvaluationJobsRequest + * @property {string|null} [parent] ListEvaluationJobsRequest parent + * @property {string|null} [filter] ListEvaluationJobsRequest filter + * @property {number|null} [pageSize] ListEvaluationJobsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationJobsRequest pageToken + */ + + /** + * Constructs a new ListEvaluationJobsRequest. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListEvaluationJobsRequest. + * @implements IListEvaluationJobsRequest + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest=} [properties] Properties to set + */ + function ListEvaluationJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @instance + */ + ListEvaluationJobsRequest.prototype.parent = ""; + + /** + * ListEvaluationJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @instance + */ + ListEvaluationJobsRequest.prototype.filter = ""; + + /** + * ListEvaluationJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @instance + */ + ListEvaluationJobsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @instance + */ + ListEvaluationJobsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEvaluationJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest} ListEvaluationJobsRequest instance + */ + ListEvaluationJobsRequest.create = function create(properties) { + return new ListEvaluationJobsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationJobsRequest message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest} message ListEvaluationJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListEvaluationJobsRequest message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest} message ListEvaluationJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest} ListEvaluationJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest} ListEvaluationJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationJobsRequest message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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 ListEvaluationJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest} ListEvaluationJobsRequest + */ + ListEvaluationJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListEvaluationJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @static + * @param {google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest} message ListEvaluationJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListEvaluationJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationJobsRequest + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest"; + }; + + return ListEvaluationJobsRequest; + })(); + + v1beta1.ListEvaluationJobsResponse = (function() { + + /** + * Properties of a ListEvaluationJobsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IListEvaluationJobsResponse + * @property {Array.|null} [evaluationJobs] ListEvaluationJobsResponse evaluationJobs + * @property {string|null} [nextPageToken] ListEvaluationJobsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationJobsResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ListEvaluationJobsResponse. + * @implements IListEvaluationJobsResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse=} [properties] Properties to set + */ + function ListEvaluationJobsResponse(properties) { + this.evaluationJobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationJobsResponse evaluationJobs. + * @member {Array.} evaluationJobs + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @instance + */ + ListEvaluationJobsResponse.prototype.evaluationJobs = $util.emptyArray; + + /** + * ListEvaluationJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @instance + */ + ListEvaluationJobsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse} ListEvaluationJobsResponse instance + */ + ListEvaluationJobsResponse.create = function create(properties) { + return new ListEvaluationJobsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationJobsResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse} message ListEvaluationJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationJobs != null && message.evaluationJobs.length) + for (var i = 0; i < message.evaluationJobs.length; ++i) + $root.google.cloud.datalabeling.v1beta1.EvaluationJob.encode(message.evaluationJobs[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 ListEvaluationJobsResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse} message ListEvaluationJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse} ListEvaluationJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.evaluationJobs && message.evaluationJobs.length)) + message.evaluationJobs = []; + message.evaluationJobs.push($root.google.cloud.datalabeling.v1beta1.EvaluationJob.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse} ListEvaluationJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationJobsResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationJobs != null && message.hasOwnProperty("evaluationJobs")) { + if (!Array.isArray(message.evaluationJobs)) + return "evaluationJobs: array expected"; + for (var i = 0; i < message.evaluationJobs.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.verify(message.evaluationJobs[i]); + if (error) + return "evaluationJobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse} ListEvaluationJobsResponse + */ + ListEvaluationJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse(); + if (object.evaluationJobs) { + if (!Array.isArray(object.evaluationJobs)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.evaluationJobs: array expected"); + message.evaluationJobs = []; + for (var i = 0; i < object.evaluationJobs.length; ++i) { + if (typeof object.evaluationJobs[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.evaluationJobs: object expected"); + message.evaluationJobs[i] = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.fromObject(object.evaluationJobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse} message ListEvaluationJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluationJobs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluationJobs && message.evaluationJobs.length) { + object.evaluationJobs = []; + for (var j = 0; j < message.evaluationJobs.length; ++j) + object.evaluationJobs[j] = $root.google.cloud.datalabeling.v1beta1.EvaluationJob.toObject(message.evaluationJobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationJobsResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse"; + }; + + return ListEvaluationJobsResponse; + })(); + + /** + * DataType enum. + * @name google.cloud.datalabeling.v1beta1.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} IMAGE=1 IMAGE value + * @property {number} VIDEO=2 VIDEO value + * @property {number} TEXT=4 TEXT value + * @property {number} GENERAL_DATA=6 GENERAL_DATA value + */ + v1beta1.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMAGE"] = 1; + values[valuesById[2] = "VIDEO"] = 2; + values[valuesById[4] = "TEXT"] = 4; + values[valuesById[6] = "GENERAL_DATA"] = 6; + return values; + })(); + + v1beta1.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IDataset + * @property {string|null} [name] Dataset name + * @property {string|null} [displayName] Dataset displayName + * @property {string|null} [description] Dataset description + * @property {google.protobuf.ITimestamp|null} [createTime] Dataset createTime + * @property {Array.|null} [inputConfigs] Dataset inputConfigs + * @property {Array.|null} [blockingResources] Dataset blockingResources + * @property {number|Long|null} [dataItemCount] Dataset dataItemCount + */ + + /** + * Constructs a new Dataset. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + this.inputConfigs = []; + this.blockingResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @instance + */ + Dataset.prototype.name = ""; + + /** + * Dataset displayName. + * @member {string} displayName + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @instance + */ + Dataset.prototype.displayName = ""; + + /** + * Dataset description. + * @member {string} description + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @instance + */ + Dataset.prototype.description = ""; + + /** + * Dataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @instance + */ + Dataset.prototype.createTime = null; + + /** + * Dataset inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @instance + */ + Dataset.prototype.inputConfigs = $util.emptyArray; + + /** + * Dataset blockingResources. + * @member {Array.} blockingResources + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @instance + */ + Dataset.prototype.blockingResources = $util.emptyArray; + + /** + * Dataset dataItemCount. + * @member {number|Long} dataItemCount + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @instance + */ + Dataset.prototype.dataItemCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @static + * @param {google.cloud.datalabeling.v1beta1.IDataset=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Dataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @static + * @param {google.cloud.datalabeling.v1beta1.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.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); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.datalabeling.v1beta1.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.blockingResources != null && message.blockingResources.length) + for (var i = 0; i < message.blockingResources.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.blockingResources[i]); + if (message.dataItemCount != null && Object.hasOwnProperty.call(message, "dataItemCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.dataItemCount); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @static + * @param {google.cloud.datalabeling.v1beta1.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.Dataset(); + 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; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.datalabeling.v1beta1.InputConfig.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.blockingResources && message.blockingResources.length)) + message.blockingResources = []; + message.blockingResources.push(reader.string()); + break; + } + case 7: { + message.dataItemCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dataset message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dataset.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"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { + if (!Array.isArray(message.inputConfigs)) + return "inputConfigs: array expected"; + for (var i = 0; i < message.inputConfigs.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.InputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.blockingResources != null && message.hasOwnProperty("blockingResources")) { + if (!Array.isArray(message.blockingResources)) + return "blockingResources: array expected"; + for (var i = 0; i < message.blockingResources.length; ++i) + if (!$util.isString(message.blockingResources[i])) + return "blockingResources: string[] expected"; + } + if (message.dataItemCount != null && message.hasOwnProperty("dataItemCount")) + if (!$util.isInteger(message.dataItemCount) && !(message.dataItemCount && $util.isInteger(message.dataItemCount.low) && $util.isInteger(message.dataItemCount.high))) + return "dataItemCount: integer|Long expected"; + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.Dataset) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.Dataset(); + 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); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Dataset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.datalabeling.v1beta1.Dataset.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Dataset.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.datalabeling.v1beta1.InputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.blockingResources) { + if (!Array.isArray(object.blockingResources)) + throw TypeError(".google.cloud.datalabeling.v1beta1.Dataset.blockingResources: array expected"); + message.blockingResources = []; + for (var i = 0; i < object.blockingResources.length; ++i) + message.blockingResources[i] = String(object.blockingResources[i]); + } + if (object.dataItemCount != null) + if ($util.Long) + (message.dataItemCount = $util.Long.fromValue(object.dataItemCount)).unsigned = false; + else if (typeof object.dataItemCount === "string") + message.dataItemCount = parseInt(object.dataItemCount, 10); + else if (typeof object.dataItemCount === "number") + message.dataItemCount = object.dataItemCount; + else if (typeof object.dataItemCount === "object") + message.dataItemCount = new $util.LongBits(object.dataItemCount.low >>> 0, object.dataItemCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @static + * @param {google.cloud.datalabeling.v1beta1.Dataset} message Dataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputConfigs = []; + object.blockingResources = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.dataItemCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataItemCount = options.longs === String ? "0" : 0; + } + 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; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.datalabeling.v1beta1.InputConfig.toObject(message.inputConfigs[j], options); + } + if (message.blockingResources && message.blockingResources.length) { + object.blockingResources = []; + for (var j = 0; j < message.blockingResources.length; ++j) + object.blockingResources[j] = message.blockingResources[j]; + } + if (message.dataItemCount != null && message.hasOwnProperty("dataItemCount")) + if (typeof message.dataItemCount === "number") + object.dataItemCount = options.longs === String ? String(message.dataItemCount) : message.dataItemCount; + else + object.dataItemCount = options.longs === String ? $util.Long.prototype.toString.call(message.dataItemCount) : options.longs === Number ? new $util.LongBits(message.dataItemCount.low >>> 0, message.dataItemCount.high >>> 0).toNumber() : message.dataItemCount; + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @instance + * @returns {Object.} JSON object + */ + Dataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dataset + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.Dataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.Dataset"; + }; + + return Dataset; + })(); + + v1beta1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IInputConfig + * @property {google.cloud.datalabeling.v1beta1.ITextMetadata|null} [textMetadata] InputConfig textMetadata + * @property {google.cloud.datalabeling.v1beta1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {google.cloud.datalabeling.v1beta1.IBigQuerySource|null} [bigquerySource] InputConfig bigquerySource + * @property {google.cloud.datalabeling.v1beta1.DataType|null} [dataType] InputConfig dataType + * @property {google.cloud.datalabeling.v1beta1.AnnotationType|null} [annotationType] InputConfig annotationType + * @property {google.cloud.datalabeling.v1beta1.IClassificationMetadata|null} [classificationMetadata] InputConfig classificationMetadata + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputConfig textMetadata. + * @member {google.cloud.datalabeling.v1beta1.ITextMetadata|null|undefined} textMetadata + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.textMetadata = null; + + /** + * InputConfig gcsSource. + * @member {google.cloud.datalabeling.v1beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig bigquerySource. + * @member {google.cloud.datalabeling.v1beta1.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.bigquerySource = null; + + /** + * InputConfig dataType. + * @member {google.cloud.datalabeling.v1beta1.DataType} dataType + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.dataType = 0; + + /** + * InputConfig annotationType. + * @member {google.cloud.datalabeling.v1beta1.AnnotationType} annotationType + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.annotationType = 0; + + /** + * InputConfig classificationMetadata. + * @member {google.cloud.datalabeling.v1beta1.IClassificationMetadata|null|undefined} classificationMetadata + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.classificationMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputConfig dataTypeMetadata. + * @member {"textMetadata"|undefined} dataTypeMetadata + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @instance + */ + Object.defineProperty(InputConfig.prototype, "dataTypeMetadata", { + get: $util.oneOfGetter($oneOfFields = ["textMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InputConfig source. + * @member {"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @instance + */ + Object.defineProperty(InputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource", "bigquerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dataType); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.datalabeling.v1beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.annotationType != null && Object.hasOwnProperty.call(message, "annotationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.annotationType); + if (message.classificationMetadata != null && Object.hasOwnProperty.call(message, "classificationMetadata")) + $root.google.cloud.datalabeling.v1beta1.ClassificationMetadata.encode(message.classificationMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.datalabeling.v1beta1.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.textMetadata != null && Object.hasOwnProperty.call(message, "textMetadata")) + $root.google.cloud.datalabeling.v1beta1.TextMetadata.encode(message.textMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.InputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + message.textMetadata = $root.google.cloud.datalabeling.v1beta1.TextMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gcsSource = $root.google.cloud.datalabeling.v1beta1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 5: { + message.bigquerySource = $root.google.cloud.datalabeling.v1beta1.BigQuerySource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.dataType = reader.int32(); + break; + } + case 3: { + message.annotationType = reader.int32(); + break; + } + case 4: { + message.classificationMetadata = $root.google.cloud.datalabeling.v1beta1.ClassificationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textMetadata != null && message.hasOwnProperty("textMetadata")) { + properties.dataTypeMetadata = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextMetadata.verify(message.textMetadata); + if (error) + return "textMetadata." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 6: + break; + } + if (message.annotationType != null && message.hasOwnProperty("annotationType")) + switch (message.annotationType) { + default: + return "annotationType: enum value expected"; + case 0: + case 1: + case 2: + case 13: + case 10: + case 11: + case 12: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + case 14: + break; + } + if (message.classificationMetadata != null && message.hasOwnProperty("classificationMetadata")) { + var error = $root.google.cloud.datalabeling.v1beta1.ClassificationMetadata.verify(message.classificationMetadata); + if (error) + return "classificationMetadata." + error; + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.InputConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.InputConfig(); + if (object.textMetadata != null) { + if (typeof object.textMetadata !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.InputConfig.textMetadata: object expected"); + message.textMetadata = $root.google.cloud.datalabeling.v1beta1.TextMetadata.fromObject(object.textMetadata); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.datalabeling.v1beta1.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.InputConfig.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.datalabeling.v1beta1.BigQuerySource.fromObject(object.bigquerySource); + } + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "IMAGE": + case 1: + message.dataType = 1; + break; + case "VIDEO": + case 2: + message.dataType = 2; + break; + case "TEXT": + case 4: + message.dataType = 4; + break; + case "GENERAL_DATA": + case 6: + message.dataType = 6; + break; + } + switch (object.annotationType) { + default: + if (typeof object.annotationType === "number") { + message.annotationType = object.annotationType; + break; + } + break; + case "ANNOTATION_TYPE_UNSPECIFIED": + case 0: + message.annotationType = 0; + break; + case "IMAGE_CLASSIFICATION_ANNOTATION": + case 1: + message.annotationType = 1; + break; + case "IMAGE_BOUNDING_BOX_ANNOTATION": + case 2: + message.annotationType = 2; + break; + case "IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION": + case 13: + message.annotationType = 13; + break; + case "IMAGE_BOUNDING_POLY_ANNOTATION": + case 10: + message.annotationType = 10; + break; + case "IMAGE_POLYLINE_ANNOTATION": + case 11: + message.annotationType = 11; + break; + case "IMAGE_SEGMENTATION_ANNOTATION": + case 12: + message.annotationType = 12; + break; + case "VIDEO_SHOTS_CLASSIFICATION_ANNOTATION": + case 3: + message.annotationType = 3; + break; + case "VIDEO_OBJECT_TRACKING_ANNOTATION": + case 4: + message.annotationType = 4; + break; + case "VIDEO_OBJECT_DETECTION_ANNOTATION": + case 5: + message.annotationType = 5; + break; + case "VIDEO_EVENT_ANNOTATION": + case 6: + message.annotationType = 6; + break; + case "TEXT_CLASSIFICATION_ANNOTATION": + case 8: + message.annotationType = 8; + break; + case "TEXT_ENTITY_EXTRACTION_ANNOTATION": + case 9: + message.annotationType = 9; + break; + case "GENERAL_CLASSIFICATION_ANNOTATION": + case 14: + message.annotationType = 14; + break; + } + if (object.classificationMetadata != null) { + if (typeof object.classificationMetadata !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.InputConfig.classificationMetadata: object expected"); + message.classificationMetadata = $root.google.cloud.datalabeling.v1beta1.ClassificationMetadata.fromObject(object.classificationMetadata); + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.InputConfig} message InputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.annotationType = options.enums === String ? "ANNOTATION_TYPE_UNSPECIFIED" : 0; + object.classificationMetadata = null; + } + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.datalabeling.v1beta1.DataType[message.dataType] : message.dataType; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.datalabeling.v1beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.annotationType != null && message.hasOwnProperty("annotationType")) + object.annotationType = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.AnnotationType[message.annotationType] === undefined ? message.annotationType : $root.google.cloud.datalabeling.v1beta1.AnnotationType[message.annotationType] : message.annotationType; + if (message.classificationMetadata != null && message.hasOwnProperty("classificationMetadata")) + object.classificationMetadata = $root.google.cloud.datalabeling.v1beta1.ClassificationMetadata.toObject(message.classificationMetadata, options); + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.datalabeling.v1beta1.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + if (message.textMetadata != null && message.hasOwnProperty("textMetadata")) { + object.textMetadata = $root.google.cloud.datalabeling.v1beta1.TextMetadata.toObject(message.textMetadata, options); + if (options.oneofs) + object.dataTypeMetadata = "textMetadata"; + } + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.InputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.InputConfig"; + }; + + return InputConfig; + })(); + + v1beta1.TextMetadata = (function() { + + /** + * Properties of a TextMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ITextMetadata + * @property {string|null} [languageCode] TextMetadata languageCode + */ + + /** + * Constructs a new TextMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a TextMetadata. + * @implements ITextMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ITextMetadata=} [properties] Properties to set + */ + function TextMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextMetadata languageCode. + * @member {string} languageCode + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @instance + */ + TextMetadata.prototype.languageCode = ""; + + /** + * Creates a new TextMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.TextMetadata} TextMetadata instance + */ + TextMetadata.create = function create(properties) { + return new TextMetadata(properties); + }; + + /** + * Encodes the specified TextMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextMetadata} message TextMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextMetadata.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); + return writer; + }; + + /** + * Encodes the specified TextMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextMetadata} message TextMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.TextMetadata} TextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.TextMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.TextMetadata} TextMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextMetadata.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"; + return null; + }; + + /** + * Creates a TextMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.TextMetadata} TextMetadata + */ + TextMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.TextMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.TextMetadata(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a TextMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.TextMetadata} message TextMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.languageCode = ""; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this TextMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @instance + * @returns {Object.} JSON object + */ + TextMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.TextMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.TextMetadata"; + }; + + return TextMetadata; + })(); + + v1beta1.ClassificationMetadata = (function() { + + /** + * Properties of a ClassificationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IClassificationMetadata + * @property {boolean|null} [isMultiLabel] ClassificationMetadata isMultiLabel + */ + + /** + * Constructs a new ClassificationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ClassificationMetadata. + * @implements IClassificationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IClassificationMetadata=} [properties] Properties to set + */ + function ClassificationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationMetadata isMultiLabel. + * @member {boolean} isMultiLabel + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @instance + */ + ClassificationMetadata.prototype.isMultiLabel = false; + + /** + * Creates a new ClassificationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IClassificationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ClassificationMetadata} ClassificationMetadata instance + */ + ClassificationMetadata.create = function create(properties) { + return new ClassificationMetadata(properties); + }; + + /** + * Encodes the specified ClassificationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ClassificationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IClassificationMetadata} message ClassificationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isMultiLabel != null && Object.hasOwnProperty.call(message, "isMultiLabel")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isMultiLabel); + return writer; + }; + + /** + * Encodes the specified ClassificationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ClassificationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IClassificationMetadata} message ClassificationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ClassificationMetadata} ClassificationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ClassificationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.isMultiLabel = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ClassificationMetadata} ClassificationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.isMultiLabel != null && message.hasOwnProperty("isMultiLabel")) + if (typeof message.isMultiLabel !== "boolean") + return "isMultiLabel: boolean expected"; + return null; + }; + + /** + * Creates a ClassificationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ClassificationMetadata} ClassificationMetadata + */ + ClassificationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ClassificationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ClassificationMetadata(); + if (object.isMultiLabel != null) + message.isMultiLabel = Boolean(object.isMultiLabel); + return message; + }; + + /** + * Creates a plain object from a ClassificationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ClassificationMetadata} message ClassificationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.isMultiLabel = false; + if (message.isMultiLabel != null && message.hasOwnProperty("isMultiLabel")) + object.isMultiLabel = message.isMultiLabel; + return object; + }; + + /** + * Converts this ClassificationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @instance + * @returns {Object.} JSON object + */ + ClassificationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ClassificationMetadata"; + }; + + return ClassificationMetadata; + })(); + + v1beta1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGcsSource + * @property {string|null} [inputUri] GcsSource inputUri + * @property {string|null} [mimeType] GcsSource mimeType + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource inputUri. + * @member {string} inputUri + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @instance + */ + GcsSource.prototype.inputUri = ""; + + /** + * GcsSource mimeType. + * @member {string} mimeType + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @instance + */ + GcsSource.prototype.mimeType = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @static + * @param {google.cloud.datalabeling.v1beta1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @static + * @param {google.cloud.datalabeling.v1beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.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.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @static + * @param {google.cloud.datalabeling.v1beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.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.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GcsSource) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GcsSource(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @static + * @param {google.cloud.datalabeling.v1beta1.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputUri = ""; + object.mimeType = ""; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GcsSource"; + }; + + return GcsSource; + })(); + + v1beta1.BigQuerySource = (function() { + + /** + * Properties of a BigQuerySource. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IBigQuerySource + * @property {string|null} [inputUri] BigQuerySource inputUri + */ + + /** + * Constructs a new BigQuerySource. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a BigQuerySource. + * @implements IBigQuerySource + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IBigQuerySource=} [properties] Properties to set + */ + function BigQuerySource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQuerySource inputUri. + * @member {string} inputUri + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @instance + */ + BigQuerySource.prototype.inputUri = ""; + + /** + * Creates a new BigQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @static + * @param {google.cloud.datalabeling.v1beta1.IBigQuerySource=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.BigQuerySource} BigQuerySource instance + */ + BigQuerySource.create = function create(properties) { + return new BigQuerySource(properties); + }; + + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BigQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @static + * @param {google.cloud.datalabeling.v1beta1.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQuerySource.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); + return writer; + }; + + /** + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BigQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @static + * @param {google.cloud.datalabeling.v1beta1.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.BigQuerySource} BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQuerySource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.BigQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.BigQuerySource} BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQuerySource message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQuerySource.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"; + return null; + }; + + /** + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.BigQuerySource} BigQuerySource + */ + BigQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.BigQuerySource) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.BigQuerySource(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + return message; + }; + + /** + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @static + * @param {google.cloud.datalabeling.v1beta1.BigQuerySource} message BigQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputUri = ""; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + return object; + }; + + /** + * Converts this BigQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @instance + * @returns {Object.} JSON object + */ + BigQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQuerySource + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.BigQuerySource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQuerySource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.BigQuerySource"; + }; + + return BigQuerySource; + })(); + + v1beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IOutputConfig + * @property {google.cloud.datalabeling.v1beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.cloud.datalabeling.v1beta1.IGcsFolderDestination|null} [gcsFolderDestination] OutputConfig gcsFolderDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.datalabeling.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig gcsFolderDestination. + * @member {google.cloud.datalabeling.v1beta1.IGcsFolderDestination|null|undefined} gcsFolderDestination + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsFolderDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|"gcsFolderDestination"|undefined} destination + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "gcsFolderDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.datalabeling.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsFolderDestination != null && Object.hasOwnProperty.call(message, "gcsFolderDestination")) + $root.google.cloud.datalabeling.v1beta1.GcsFolderDestination.encode(message.gcsFolderDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.datalabeling.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gcsFolderDestination = $root.google.cloud.datalabeling.v1beta1.GcsFolderDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.gcsFolderDestination != null && message.hasOwnProperty("gcsFolderDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.GcsFolderDestination.verify(message.gcsFolderDestination); + if (error) + return "gcsFolderDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.OutputConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.datalabeling.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.gcsFolderDestination != null) { + if (typeof object.gcsFolderDestination !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.OutputConfig.gcsFolderDestination: object expected"); + message.gcsFolderDestination = $root.google.cloud.datalabeling.v1beta1.GcsFolderDestination.fromObject(object.gcsFolderDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.datalabeling.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.gcsFolderDestination != null && message.hasOwnProperty("gcsFolderDestination")) { + object.gcsFolderDestination = $root.google.cloud.datalabeling.v1beta1.GcsFolderDestination.toObject(message.gcsFolderDestination, options); + if (options.oneofs) + object.destination = "gcsFolderDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGcsDestination + * @property {string|null} [outputUri] GcsDestination outputUri + * @property {string|null} [mimeType] GcsDestination mimeType + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination outputUri. + * @member {string} outputUri + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.outputUri = ""; + + /** + * GcsDestination mimeType. + * @member {string} mimeType + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.mimeType = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @static + * @param {google.cloud.datalabeling.v1beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @static + * @param {google.cloud.datalabeling.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUri); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @static + * @param {google.cloud.datalabeling.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUri = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GcsDestination) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GcsDestination(); + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @static + * @param {google.cloud.datalabeling.v1beta1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.outputUri = ""; + object.mimeType = ""; + } + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1beta1.GcsFolderDestination = (function() { + + /** + * Properties of a GcsFolderDestination. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IGcsFolderDestination + * @property {string|null} [outputFolderUri] GcsFolderDestination outputFolderUri + */ + + /** + * Constructs a new GcsFolderDestination. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a GcsFolderDestination. + * @implements IGcsFolderDestination + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IGcsFolderDestination=} [properties] Properties to set + */ + function GcsFolderDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsFolderDestination outputFolderUri. + * @member {string} outputFolderUri + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @instance + */ + GcsFolderDestination.prototype.outputFolderUri = ""; + + /** + * Creates a new GcsFolderDestination instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @static + * @param {google.cloud.datalabeling.v1beta1.IGcsFolderDestination=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.GcsFolderDestination} GcsFolderDestination instance + */ + GcsFolderDestination.create = function create(properties) { + return new GcsFolderDestination(properties); + }; + + /** + * Encodes the specified GcsFolderDestination message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsFolderDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @static + * @param {google.cloud.datalabeling.v1beta1.IGcsFolderDestination} message GcsFolderDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsFolderDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputFolderUri != null && Object.hasOwnProperty.call(message, "outputFolderUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputFolderUri); + return writer; + }; + + /** + * Encodes the specified GcsFolderDestination message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.GcsFolderDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @static + * @param {google.cloud.datalabeling.v1beta1.IGcsFolderDestination} message GcsFolderDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsFolderDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsFolderDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.GcsFolderDestination} GcsFolderDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsFolderDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.GcsFolderDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputFolderUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsFolderDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.GcsFolderDestination} GcsFolderDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsFolderDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsFolderDestination message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsFolderDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputFolderUri != null && message.hasOwnProperty("outputFolderUri")) + if (!$util.isString(message.outputFolderUri)) + return "outputFolderUri: string expected"; + return null; + }; + + /** + * Creates a GcsFolderDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.GcsFolderDestination} GcsFolderDestination + */ + GcsFolderDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.GcsFolderDestination) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.GcsFolderDestination(); + if (object.outputFolderUri != null) + message.outputFolderUri = String(object.outputFolderUri); + return message; + }; + + /** + * Creates a plain object from a GcsFolderDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @static + * @param {google.cloud.datalabeling.v1beta1.GcsFolderDestination} message GcsFolderDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsFolderDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputFolderUri = ""; + if (message.outputFolderUri != null && message.hasOwnProperty("outputFolderUri")) + object.outputFolderUri = message.outputFolderUri; + return object; + }; + + /** + * Converts this GcsFolderDestination to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @instance + * @returns {Object.} JSON object + */ + GcsFolderDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsFolderDestination + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.GcsFolderDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsFolderDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.GcsFolderDestination"; + }; + + return GcsFolderDestination; + })(); + + v1beta1.DataItem = (function() { + + /** + * Properties of a DataItem. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IDataItem + * @property {google.cloud.datalabeling.v1beta1.IImagePayload|null} [imagePayload] DataItem imagePayload + * @property {google.cloud.datalabeling.v1beta1.ITextPayload|null} [textPayload] DataItem textPayload + * @property {google.cloud.datalabeling.v1beta1.IVideoPayload|null} [videoPayload] DataItem videoPayload + * @property {string|null} [name] DataItem name + */ + + /** + * Constructs a new DataItem. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a DataItem. + * @implements IDataItem + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IDataItem=} [properties] Properties to set + */ + function DataItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataItem imagePayload. + * @member {google.cloud.datalabeling.v1beta1.IImagePayload|null|undefined} imagePayload + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @instance + */ + DataItem.prototype.imagePayload = null; + + /** + * DataItem textPayload. + * @member {google.cloud.datalabeling.v1beta1.ITextPayload|null|undefined} textPayload + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @instance + */ + DataItem.prototype.textPayload = null; + + /** + * DataItem videoPayload. + * @member {google.cloud.datalabeling.v1beta1.IVideoPayload|null|undefined} videoPayload + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @instance + */ + DataItem.prototype.videoPayload = null; + + /** + * DataItem name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @instance + */ + DataItem.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataItem payload. + * @member {"imagePayload"|"textPayload"|"videoPayload"|undefined} payload + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @instance + */ + Object.defineProperty(DataItem.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["imagePayload", "textPayload", "videoPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataItem instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @static + * @param {google.cloud.datalabeling.v1beta1.IDataItem=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.DataItem} DataItem instance + */ + DataItem.create = function create(properties) { + return new DataItem(properties); + }; + + /** + * Encodes the specified DataItem message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DataItem.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @static + * @param {google.cloud.datalabeling.v1beta1.IDataItem} message DataItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataItem.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.imagePayload != null && Object.hasOwnProperty.call(message, "imagePayload")) + $root.google.cloud.datalabeling.v1beta1.ImagePayload.encode(message.imagePayload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.textPayload != null && Object.hasOwnProperty.call(message, "textPayload")) + $root.google.cloud.datalabeling.v1beta1.TextPayload.encode(message.textPayload, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.videoPayload != null && Object.hasOwnProperty.call(message, "videoPayload")) + $root.google.cloud.datalabeling.v1beta1.VideoPayload.encode(message.videoPayload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataItem message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.DataItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @static + * @param {google.cloud.datalabeling.v1beta1.IDataItem} message DataItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataItem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.DataItem} DataItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.DataItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.imagePayload = $root.google.cloud.datalabeling.v1beta1.ImagePayload.decode(reader, reader.uint32()); + break; + } + case 3: { + message.textPayload = $root.google.cloud.datalabeling.v1beta1.TextPayload.decode(reader, reader.uint32()); + break; + } + case 4: { + message.videoPayload = $root.google.cloud.datalabeling.v1beta1.VideoPayload.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.DataItem} DataItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataItem message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imagePayload != null && message.hasOwnProperty("imagePayload")) { + properties.payload = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ImagePayload.verify(message.imagePayload); + if (error) + return "imagePayload." + error; + } + } + if (message.textPayload != null && message.hasOwnProperty("textPayload")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextPayload.verify(message.textPayload); + if (error) + return "textPayload." + error; + } + } + if (message.videoPayload != null && message.hasOwnProperty("videoPayload")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.VideoPayload.verify(message.videoPayload); + if (error) + return "videoPayload." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DataItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.DataItem} DataItem + */ + DataItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.DataItem) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.DataItem(); + if (object.imagePayload != null) { + if (typeof object.imagePayload !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.DataItem.imagePayload: object expected"); + message.imagePayload = $root.google.cloud.datalabeling.v1beta1.ImagePayload.fromObject(object.imagePayload); + } + if (object.textPayload != null) { + if (typeof object.textPayload !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.DataItem.textPayload: object expected"); + message.textPayload = $root.google.cloud.datalabeling.v1beta1.TextPayload.fromObject(object.textPayload); + } + if (object.videoPayload != null) { + if (typeof object.videoPayload !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.DataItem.videoPayload: object expected"); + message.videoPayload = $root.google.cloud.datalabeling.v1beta1.VideoPayload.fromObject(object.videoPayload); + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DataItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @static + * @param {google.cloud.datalabeling.v1beta1.DataItem} message DataItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataItem.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; + if (message.imagePayload != null && message.hasOwnProperty("imagePayload")) { + object.imagePayload = $root.google.cloud.datalabeling.v1beta1.ImagePayload.toObject(message.imagePayload, options); + if (options.oneofs) + object.payload = "imagePayload"; + } + if (message.textPayload != null && message.hasOwnProperty("textPayload")) { + object.textPayload = $root.google.cloud.datalabeling.v1beta1.TextPayload.toObject(message.textPayload, options); + if (options.oneofs) + object.payload = "textPayload"; + } + if (message.videoPayload != null && message.hasOwnProperty("videoPayload")) { + object.videoPayload = $root.google.cloud.datalabeling.v1beta1.VideoPayload.toObject(message.videoPayload, options); + if (options.oneofs) + object.payload = "videoPayload"; + } + return object; + }; + + /** + * Converts this DataItem to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @instance + * @returns {Object.} JSON object + */ + DataItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataItem + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.DataItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.DataItem"; + }; + + return DataItem; + })(); + + v1beta1.AnnotatedDataset = (function() { + + /** + * Properties of an AnnotatedDataset. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IAnnotatedDataset + * @property {string|null} [name] AnnotatedDataset name + * @property {string|null} [displayName] AnnotatedDataset displayName + * @property {string|null} [description] AnnotatedDataset description + * @property {google.cloud.datalabeling.v1beta1.AnnotationSource|null} [annotationSource] AnnotatedDataset annotationSource + * @property {google.cloud.datalabeling.v1beta1.AnnotationType|null} [annotationType] AnnotatedDataset annotationType + * @property {number|Long|null} [exampleCount] AnnotatedDataset exampleCount + * @property {number|Long|null} [completedExampleCount] AnnotatedDataset completedExampleCount + * @property {google.cloud.datalabeling.v1beta1.ILabelStats|null} [labelStats] AnnotatedDataset labelStats + * @property {google.protobuf.ITimestamp|null} [createTime] AnnotatedDataset createTime + * @property {google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata|null} [metadata] AnnotatedDataset metadata + * @property {Array.|null} [blockingResources] AnnotatedDataset blockingResources + */ + + /** + * Constructs a new AnnotatedDataset. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an AnnotatedDataset. + * @implements IAnnotatedDataset + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IAnnotatedDataset=} [properties] Properties to set + */ + function AnnotatedDataset(properties) { + this.blockingResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotatedDataset name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.name = ""; + + /** + * AnnotatedDataset displayName. + * @member {string} displayName + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.displayName = ""; + + /** + * AnnotatedDataset description. + * @member {string} description + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.description = ""; + + /** + * AnnotatedDataset annotationSource. + * @member {google.cloud.datalabeling.v1beta1.AnnotationSource} annotationSource + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.annotationSource = 0; + + /** + * AnnotatedDataset annotationType. + * @member {google.cloud.datalabeling.v1beta1.AnnotationType} annotationType + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.annotationType = 0; + + /** + * AnnotatedDataset exampleCount. + * @member {number|Long} exampleCount + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.exampleCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AnnotatedDataset completedExampleCount. + * @member {number|Long} completedExampleCount + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.completedExampleCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AnnotatedDataset labelStats. + * @member {google.cloud.datalabeling.v1beta1.ILabelStats|null|undefined} labelStats + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.labelStats = null; + + /** + * AnnotatedDataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.createTime = null; + + /** + * AnnotatedDataset metadata. + * @member {google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata|null|undefined} metadata + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.metadata = null; + + /** + * AnnotatedDataset blockingResources. + * @member {Array.} blockingResources + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + */ + AnnotatedDataset.prototype.blockingResources = $util.emptyArray; + + /** + * Creates a new AnnotatedDataset instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotatedDataset=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.AnnotatedDataset} AnnotatedDataset instance + */ + AnnotatedDataset.create = function create(properties) { + return new AnnotatedDataset(properties); + }; + + /** + * Encodes the specified AnnotatedDataset message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotatedDataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotatedDataset} message AnnotatedDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedDataset.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.annotationSource != null && Object.hasOwnProperty.call(message, "annotationSource")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.annotationSource); + if (message.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.exampleCount); + if (message.completedExampleCount != null && Object.hasOwnProperty.call(message, "completedExampleCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.completedExampleCount); + if (message.labelStats != null && Object.hasOwnProperty.call(message, "labelStats")) + $root.google.cloud.datalabeling.v1beta1.LabelStats.encode(message.labelStats, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.annotationType != null && Object.hasOwnProperty.call(message, "annotationType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.annotationType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.encode(message.metadata, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.blockingResources != null && message.blockingResources.length) + for (var i = 0; i < message.blockingResources.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.blockingResources[i]); + return writer; + }; + + /** + * Encodes the specified AnnotatedDataset message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotatedDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotatedDataset} message AnnotatedDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotatedDataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.AnnotatedDataset} AnnotatedDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedDataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.AnnotatedDataset(); + 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 9: { + message.description = reader.string(); + break; + } + case 3: { + message.annotationSource = reader.int32(); + break; + } + case 8: { + message.annotationType = reader.int32(); + break; + } + case 4: { + message.exampleCount = reader.int64(); + break; + } + case 5: { + message.completedExampleCount = reader.int64(); + break; + } + case 6: { + message.labelStats = $root.google.cloud.datalabeling.v1beta1.LabelStats.decode(reader, reader.uint32()); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.metadata = $root.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.blockingResources && message.blockingResources.length)) + message.blockingResources = []; + message.blockingResources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotatedDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.AnnotatedDataset} AnnotatedDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotatedDataset message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotatedDataset.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"; + if (message.annotationSource != null && message.hasOwnProperty("annotationSource")) + switch (message.annotationSource) { + default: + return "annotationSource: enum value expected"; + case 0: + case 3: + break; + } + if (message.annotationType != null && message.hasOwnProperty("annotationType")) + switch (message.annotationType) { + default: + return "annotationType: enum value expected"; + case 0: + case 1: + case 2: + case 13: + case 10: + case 11: + case 12: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + case 14: + break; + } + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount) && !(message.exampleCount && $util.isInteger(message.exampleCount.low) && $util.isInteger(message.exampleCount.high))) + return "exampleCount: integer|Long expected"; + if (message.completedExampleCount != null && message.hasOwnProperty("completedExampleCount")) + if (!$util.isInteger(message.completedExampleCount) && !(message.completedExampleCount && $util.isInteger(message.completedExampleCount.low) && $util.isInteger(message.completedExampleCount.high))) + return "completedExampleCount: integer|Long expected"; + if (message.labelStats != null && message.hasOwnProperty("labelStats")) { + var error = $root.google.cloud.datalabeling.v1beta1.LabelStats.verify(message.labelStats); + if (error) + return "labelStats." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.blockingResources != null && message.hasOwnProperty("blockingResources")) { + if (!Array.isArray(message.blockingResources)) + return "blockingResources: array expected"; + for (var i = 0; i < message.blockingResources.length; ++i) + if (!$util.isString(message.blockingResources[i])) + return "blockingResources: string[] expected"; + } + return null; + }; + + /** + * Creates an AnnotatedDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.AnnotatedDataset} AnnotatedDataset + */ + AnnotatedDataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.AnnotatedDataset) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.AnnotatedDataset(); + 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); + switch (object.annotationSource) { + default: + if (typeof object.annotationSource === "number") { + message.annotationSource = object.annotationSource; + break; + } + break; + case "ANNOTATION_SOURCE_UNSPECIFIED": + case 0: + message.annotationSource = 0; + break; + case "OPERATOR": + case 3: + message.annotationSource = 3; + break; + } + switch (object.annotationType) { + default: + if (typeof object.annotationType === "number") { + message.annotationType = object.annotationType; + break; + } + break; + case "ANNOTATION_TYPE_UNSPECIFIED": + case 0: + message.annotationType = 0; + break; + case "IMAGE_CLASSIFICATION_ANNOTATION": + case 1: + message.annotationType = 1; + break; + case "IMAGE_BOUNDING_BOX_ANNOTATION": + case 2: + message.annotationType = 2; + break; + case "IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION": + case 13: + message.annotationType = 13; + break; + case "IMAGE_BOUNDING_POLY_ANNOTATION": + case 10: + message.annotationType = 10; + break; + case "IMAGE_POLYLINE_ANNOTATION": + case 11: + message.annotationType = 11; + break; + case "IMAGE_SEGMENTATION_ANNOTATION": + case 12: + message.annotationType = 12; + break; + case "VIDEO_SHOTS_CLASSIFICATION_ANNOTATION": + case 3: + message.annotationType = 3; + break; + case "VIDEO_OBJECT_TRACKING_ANNOTATION": + case 4: + message.annotationType = 4; + break; + case "VIDEO_OBJECT_DETECTION_ANNOTATION": + case 5: + message.annotationType = 5; + break; + case "VIDEO_EVENT_ANNOTATION": + case 6: + message.annotationType = 6; + break; + case "TEXT_CLASSIFICATION_ANNOTATION": + case 8: + message.annotationType = 8; + break; + case "TEXT_ENTITY_EXTRACTION_ANNOTATION": + case 9: + message.annotationType = 9; + break; + case "GENERAL_CLASSIFICATION_ANNOTATION": + case 14: + message.annotationType = 14; + break; + } + if (object.exampleCount != null) + if ($util.Long) + (message.exampleCount = $util.Long.fromValue(object.exampleCount)).unsigned = false; + else if (typeof object.exampleCount === "string") + message.exampleCount = parseInt(object.exampleCount, 10); + else if (typeof object.exampleCount === "number") + message.exampleCount = object.exampleCount; + else if (typeof object.exampleCount === "object") + message.exampleCount = new $util.LongBits(object.exampleCount.low >>> 0, object.exampleCount.high >>> 0).toNumber(); + if (object.completedExampleCount != null) + if ($util.Long) + (message.completedExampleCount = $util.Long.fromValue(object.completedExampleCount)).unsigned = false; + else if (typeof object.completedExampleCount === "string") + message.completedExampleCount = parseInt(object.completedExampleCount, 10); + else if (typeof object.completedExampleCount === "number") + message.completedExampleCount = object.completedExampleCount; + else if (typeof object.completedExampleCount === "object") + message.completedExampleCount = new $util.LongBits(object.completedExampleCount.low >>> 0, object.completedExampleCount.high >>> 0).toNumber(); + if (object.labelStats != null) { + if (typeof object.labelStats !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDataset.labelStats: object expected"); + message.labelStats = $root.google.cloud.datalabeling.v1beta1.LabelStats.fromObject(object.labelStats); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDataset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDataset.metadata: object expected"); + message.metadata = $root.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.fromObject(object.metadata); + } + if (object.blockingResources) { + if (!Array.isArray(object.blockingResources)) + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDataset.blockingResources: array expected"); + message.blockingResources = []; + for (var i = 0; i < object.blockingResources.length; ++i) + message.blockingResources[i] = String(object.blockingResources[i]); + } + return message; + }; + + /** + * Creates a plain object from an AnnotatedDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @static + * @param {google.cloud.datalabeling.v1beta1.AnnotatedDataset} message AnnotatedDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotatedDataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blockingResources = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.annotationSource = options.enums === String ? "ANNOTATION_SOURCE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.exampleCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.exampleCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.completedExampleCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.completedExampleCount = options.longs === String ? "0" : 0; + object.labelStats = null; + object.createTime = null; + object.annotationType = options.enums === String ? "ANNOTATION_TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.metadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.annotationSource != null && message.hasOwnProperty("annotationSource")) + object.annotationSource = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.AnnotationSource[message.annotationSource] === undefined ? message.annotationSource : $root.google.cloud.datalabeling.v1beta1.AnnotationSource[message.annotationSource] : message.annotationSource; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (typeof message.exampleCount === "number") + object.exampleCount = options.longs === String ? String(message.exampleCount) : message.exampleCount; + else + object.exampleCount = options.longs === String ? $util.Long.prototype.toString.call(message.exampleCount) : options.longs === Number ? new $util.LongBits(message.exampleCount.low >>> 0, message.exampleCount.high >>> 0).toNumber() : message.exampleCount; + if (message.completedExampleCount != null && message.hasOwnProperty("completedExampleCount")) + if (typeof message.completedExampleCount === "number") + object.completedExampleCount = options.longs === String ? String(message.completedExampleCount) : message.completedExampleCount; + else + object.completedExampleCount = options.longs === String ? $util.Long.prototype.toString.call(message.completedExampleCount) : options.longs === Number ? new $util.LongBits(message.completedExampleCount.low >>> 0, message.completedExampleCount.high >>> 0).toNumber() : message.completedExampleCount; + if (message.labelStats != null && message.hasOwnProperty("labelStats")) + object.labelStats = $root.google.cloud.datalabeling.v1beta1.LabelStats.toObject(message.labelStats, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.annotationType != null && message.hasOwnProperty("annotationType")) + object.annotationType = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.AnnotationType[message.annotationType] === undefined ? message.annotationType : $root.google.cloud.datalabeling.v1beta1.AnnotationType[message.annotationType] : message.annotationType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.toObject(message.metadata, options); + if (message.blockingResources && message.blockingResources.length) { + object.blockingResources = []; + for (var j = 0; j < message.blockingResources.length; ++j) + object.blockingResources[j] = message.blockingResources[j]; + } + return object; + }; + + /** + * Converts this AnnotatedDataset to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @instance + * @returns {Object.} JSON object + */ + AnnotatedDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotatedDataset + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotatedDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.AnnotatedDataset"; + }; + + return AnnotatedDataset; + })(); + + v1beta1.LabelStats = (function() { + + /** + * Properties of a LabelStats. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelStats + * @property {Object.|null} [exampleCount] LabelStats exampleCount + */ + + /** + * Constructs a new LabelStats. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelStats. + * @implements ILabelStats + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelStats=} [properties] Properties to set + */ + function LabelStats(properties) { + this.exampleCount = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelStats exampleCount. + * @member {Object.} exampleCount + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @instance + */ + LabelStats.prototype.exampleCount = $util.emptyObject; + + /** + * Creates a new LabelStats instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelStats=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelStats} LabelStats instance + */ + LabelStats.create = function create(properties) { + return new LabelStats(properties); + }; + + /** + * Encodes the specified LabelStats message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelStats} message LabelStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + for (var keys = Object.keys(message.exampleCount), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.exampleCount[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelStats message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelStats} message LabelStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelStats} LabelStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelStats(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.exampleCount === $util.emptyObject) + message.exampleCount = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.exampleCount[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelStats} LabelStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelStats message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) { + if (!$util.isObject(message.exampleCount)) + return "exampleCount: object expected"; + var key = Object.keys(message.exampleCount); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.exampleCount[key[i]]) && !(message.exampleCount[key[i]] && $util.isInteger(message.exampleCount[key[i]].low) && $util.isInteger(message.exampleCount[key[i]].high))) + return "exampleCount: integer|Long{k:string} expected"; + } + return null; + }; + + /** + * Creates a LabelStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelStats} LabelStats + */ + LabelStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelStats) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelStats(); + if (object.exampleCount) { + if (typeof object.exampleCount !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelStats.exampleCount: object expected"); + message.exampleCount = {}; + for (var keys = Object.keys(object.exampleCount), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.exampleCount[keys[i]] = $util.Long.fromValue(object.exampleCount[keys[i]])).unsigned = false; + else if (typeof object.exampleCount[keys[i]] === "string") + message.exampleCount[keys[i]] = parseInt(object.exampleCount[keys[i]], 10); + else if (typeof object.exampleCount[keys[i]] === "number") + message.exampleCount[keys[i]] = object.exampleCount[keys[i]]; + else if (typeof object.exampleCount[keys[i]] === "object") + message.exampleCount[keys[i]] = new $util.LongBits(object.exampleCount[keys[i]].low >>> 0, object.exampleCount[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a LabelStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelStats} message LabelStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.exampleCount = {}; + var keys2; + if (message.exampleCount && (keys2 = Object.keys(message.exampleCount)).length) { + object.exampleCount = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.exampleCount[keys2[j]] === "number") + object.exampleCount[keys2[j]] = options.longs === String ? String(message.exampleCount[keys2[j]]) : message.exampleCount[keys2[j]]; + else + object.exampleCount[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.exampleCount[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.exampleCount[keys2[j]].low >>> 0, message.exampleCount[keys2[j]].high >>> 0).toNumber() : message.exampleCount[keys2[j]]; + } + return object; + }; + + /** + * Converts this LabelStats to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @instance + * @returns {Object.} JSON object + */ + LabelStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelStats + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelStats"; + }; + + return LabelStats; + })(); + + v1beta1.AnnotatedDatasetMetadata = (function() { + + /** + * Properties of an AnnotatedDatasetMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IAnnotatedDatasetMetadata + * @property {google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null} [imageClassificationConfig] AnnotatedDatasetMetadata imageClassificationConfig + * @property {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null} [boundingPolyConfig] AnnotatedDatasetMetadata boundingPolyConfig + * @property {google.cloud.datalabeling.v1beta1.IPolylineConfig|null} [polylineConfig] AnnotatedDatasetMetadata polylineConfig + * @property {google.cloud.datalabeling.v1beta1.ISegmentationConfig|null} [segmentationConfig] AnnotatedDatasetMetadata segmentationConfig + * @property {google.cloud.datalabeling.v1beta1.IVideoClassificationConfig|null} [videoClassificationConfig] AnnotatedDatasetMetadata videoClassificationConfig + * @property {google.cloud.datalabeling.v1beta1.IObjectDetectionConfig|null} [objectDetectionConfig] AnnotatedDatasetMetadata objectDetectionConfig + * @property {google.cloud.datalabeling.v1beta1.IObjectTrackingConfig|null} [objectTrackingConfig] AnnotatedDatasetMetadata objectTrackingConfig + * @property {google.cloud.datalabeling.v1beta1.IEventConfig|null} [eventConfig] AnnotatedDatasetMetadata eventConfig + * @property {google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null} [textClassificationConfig] AnnotatedDatasetMetadata textClassificationConfig + * @property {google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig|null} [textEntityExtractionConfig] AnnotatedDatasetMetadata textEntityExtractionConfig + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [humanAnnotationConfig] AnnotatedDatasetMetadata humanAnnotationConfig + */ + + /** + * Constructs a new AnnotatedDatasetMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an AnnotatedDatasetMetadata. + * @implements IAnnotatedDatasetMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata=} [properties] Properties to set + */ + function AnnotatedDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotatedDatasetMetadata imageClassificationConfig. + * @member {google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null|undefined} imageClassificationConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.imageClassificationConfig = null; + + /** + * AnnotatedDatasetMetadata boundingPolyConfig. + * @member {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null|undefined} boundingPolyConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.boundingPolyConfig = null; + + /** + * AnnotatedDatasetMetadata polylineConfig. + * @member {google.cloud.datalabeling.v1beta1.IPolylineConfig|null|undefined} polylineConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.polylineConfig = null; + + /** + * AnnotatedDatasetMetadata segmentationConfig. + * @member {google.cloud.datalabeling.v1beta1.ISegmentationConfig|null|undefined} segmentationConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.segmentationConfig = null; + + /** + * AnnotatedDatasetMetadata videoClassificationConfig. + * @member {google.cloud.datalabeling.v1beta1.IVideoClassificationConfig|null|undefined} videoClassificationConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.videoClassificationConfig = null; + + /** + * AnnotatedDatasetMetadata objectDetectionConfig. + * @member {google.cloud.datalabeling.v1beta1.IObjectDetectionConfig|null|undefined} objectDetectionConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.objectDetectionConfig = null; + + /** + * AnnotatedDatasetMetadata objectTrackingConfig. + * @member {google.cloud.datalabeling.v1beta1.IObjectTrackingConfig|null|undefined} objectTrackingConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.objectTrackingConfig = null; + + /** + * AnnotatedDatasetMetadata eventConfig. + * @member {google.cloud.datalabeling.v1beta1.IEventConfig|null|undefined} eventConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.eventConfig = null; + + /** + * AnnotatedDatasetMetadata textClassificationConfig. + * @member {google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null|undefined} textClassificationConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.textClassificationConfig = null; + + /** + * AnnotatedDatasetMetadata textEntityExtractionConfig. + * @member {google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig|null|undefined} textEntityExtractionConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.textEntityExtractionConfig = null; + + /** + * AnnotatedDatasetMetadata humanAnnotationConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} humanAnnotationConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + AnnotatedDatasetMetadata.prototype.humanAnnotationConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnnotatedDatasetMetadata annotationRequestConfig. + * @member {"imageClassificationConfig"|"boundingPolyConfig"|"polylineConfig"|"segmentationConfig"|"videoClassificationConfig"|"objectDetectionConfig"|"objectTrackingConfig"|"eventConfig"|"textClassificationConfig"|"textEntityExtractionConfig"|undefined} annotationRequestConfig + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + */ + Object.defineProperty(AnnotatedDatasetMetadata.prototype, "annotationRequestConfig", { + get: $util.oneOfGetter($oneOfFields = ["imageClassificationConfig", "boundingPolyConfig", "polylineConfig", "segmentationConfig", "videoClassificationConfig", "objectDetectionConfig", "objectTrackingConfig", "eventConfig", "textClassificationConfig", "textEntityExtractionConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnnotatedDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata} AnnotatedDatasetMetadata instance + */ + AnnotatedDatasetMetadata.create = function create(properties) { + return new AnnotatedDatasetMetadata(properties); + }; + + /** + * Encodes the specified AnnotatedDatasetMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata} message AnnotatedDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.humanAnnotationConfig != null && Object.hasOwnProperty.call(message, "humanAnnotationConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.humanAnnotationConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.imageClassificationConfig != null && Object.hasOwnProperty.call(message, "imageClassificationConfig")) + $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.encode(message.imageClassificationConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boundingPolyConfig != null && Object.hasOwnProperty.call(message, "boundingPolyConfig")) + $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.encode(message.boundingPolyConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.polylineConfig != null && Object.hasOwnProperty.call(message, "polylineConfig")) + $root.google.cloud.datalabeling.v1beta1.PolylineConfig.encode(message.polylineConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.segmentationConfig != null && Object.hasOwnProperty.call(message, "segmentationConfig")) + $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.encode(message.segmentationConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.videoClassificationConfig != null && Object.hasOwnProperty.call(message, "videoClassificationConfig")) + $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.encode(message.videoClassificationConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.objectDetectionConfig != null && Object.hasOwnProperty.call(message, "objectDetectionConfig")) + $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.encode(message.objectDetectionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.objectTrackingConfig != null && Object.hasOwnProperty.call(message, "objectTrackingConfig")) + $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.encode(message.objectTrackingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventConfig != null && Object.hasOwnProperty.call(message, "eventConfig")) + $root.google.cloud.datalabeling.v1beta1.EventConfig.encode(message.eventConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.textClassificationConfig != null && Object.hasOwnProperty.call(message, "textClassificationConfig")) + $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.encode(message.textClassificationConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.textEntityExtractionConfig != null && Object.hasOwnProperty.call(message, "textEntityExtractionConfig")) + $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.encode(message.textEntityExtractionConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotatedDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IAnnotatedDatasetMetadata} message AnnotatedDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotatedDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata} AnnotatedDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.imageClassificationConfig = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.boundingPolyConfig = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.polylineConfig = $root.google.cloud.datalabeling.v1beta1.PolylineConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.segmentationConfig = $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.videoClassificationConfig = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.objectDetectionConfig = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.objectTrackingConfig = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.eventConfig = $root.google.cloud.datalabeling.v1beta1.EventConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.textClassificationConfig = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.textEntityExtractionConfig = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.decode(reader, reader.uint32()); + break; + } + case 1: { + message.humanAnnotationConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotatedDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata} AnnotatedDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotatedDatasetMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotatedDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageClassificationConfig != null && message.hasOwnProperty("imageClassificationConfig")) { + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.verify(message.imageClassificationConfig); + if (error) + return "imageClassificationConfig." + error; + } + } + if (message.boundingPolyConfig != null && message.hasOwnProperty("boundingPolyConfig")) { + if (properties.annotationRequestConfig === 1) + return "annotationRequestConfig: multiple values"; + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.verify(message.boundingPolyConfig); + if (error) + return "boundingPolyConfig." + error; + } + } + if (message.polylineConfig != null && message.hasOwnProperty("polylineConfig")) { + if (properties.annotationRequestConfig === 1) + return "annotationRequestConfig: multiple values"; + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.PolylineConfig.verify(message.polylineConfig); + if (error) + return "polylineConfig." + error; + } + } + if (message.segmentationConfig != null && message.hasOwnProperty("segmentationConfig")) { + if (properties.annotationRequestConfig === 1) + return "annotationRequestConfig: multiple values"; + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.verify(message.segmentationConfig); + if (error) + return "segmentationConfig." + error; + } + } + if (message.videoClassificationConfig != null && message.hasOwnProperty("videoClassificationConfig")) { + if (properties.annotationRequestConfig === 1) + return "annotationRequestConfig: multiple values"; + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.verify(message.videoClassificationConfig); + if (error) + return "videoClassificationConfig." + error; + } + } + if (message.objectDetectionConfig != null && message.hasOwnProperty("objectDetectionConfig")) { + if (properties.annotationRequestConfig === 1) + return "annotationRequestConfig: multiple values"; + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.verify(message.objectDetectionConfig); + if (error) + return "objectDetectionConfig." + error; + } + } + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) { + if (properties.annotationRequestConfig === 1) + return "annotationRequestConfig: multiple values"; + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.verify(message.objectTrackingConfig); + if (error) + return "objectTrackingConfig." + error; + } + } + if (message.eventConfig != null && message.hasOwnProperty("eventConfig")) { + if (properties.annotationRequestConfig === 1) + return "annotationRequestConfig: multiple values"; + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.EventConfig.verify(message.eventConfig); + if (error) + return "eventConfig." + error; + } + } + if (message.textClassificationConfig != null && message.hasOwnProperty("textClassificationConfig")) { + if (properties.annotationRequestConfig === 1) + return "annotationRequestConfig: multiple values"; + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.verify(message.textClassificationConfig); + if (error) + return "textClassificationConfig." + error; + } + } + if (message.textEntityExtractionConfig != null && message.hasOwnProperty("textEntityExtractionConfig")) { + if (properties.annotationRequestConfig === 1) + return "annotationRequestConfig: multiple values"; + properties.annotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.verify(message.textEntityExtractionConfig); + if (error) + return "textEntityExtractionConfig." + error; + } + } + if (message.humanAnnotationConfig != null && message.hasOwnProperty("humanAnnotationConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.humanAnnotationConfig); + if (error) + return "humanAnnotationConfig." + error; + } + return null; + }; + + /** + * Creates an AnnotatedDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata} AnnotatedDatasetMetadata + */ + AnnotatedDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata(); + if (object.imageClassificationConfig != null) { + if (typeof object.imageClassificationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.imageClassificationConfig: object expected"); + message.imageClassificationConfig = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.fromObject(object.imageClassificationConfig); + } + if (object.boundingPolyConfig != null) { + if (typeof object.boundingPolyConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.boundingPolyConfig: object expected"); + message.boundingPolyConfig = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.fromObject(object.boundingPolyConfig); + } + if (object.polylineConfig != null) { + if (typeof object.polylineConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.polylineConfig: object expected"); + message.polylineConfig = $root.google.cloud.datalabeling.v1beta1.PolylineConfig.fromObject(object.polylineConfig); + } + if (object.segmentationConfig != null) { + if (typeof object.segmentationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.segmentationConfig: object expected"); + message.segmentationConfig = $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.fromObject(object.segmentationConfig); + } + if (object.videoClassificationConfig != null) { + if (typeof object.videoClassificationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.videoClassificationConfig: object expected"); + message.videoClassificationConfig = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.fromObject(object.videoClassificationConfig); + } + if (object.objectDetectionConfig != null) { + if (typeof object.objectDetectionConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.objectDetectionConfig: object expected"); + message.objectDetectionConfig = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.fromObject(object.objectDetectionConfig); + } + if (object.objectTrackingConfig != null) { + if (typeof object.objectTrackingConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.objectTrackingConfig: object expected"); + message.objectTrackingConfig = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.fromObject(object.objectTrackingConfig); + } + if (object.eventConfig != null) { + if (typeof object.eventConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.eventConfig: object expected"); + message.eventConfig = $root.google.cloud.datalabeling.v1beta1.EventConfig.fromObject(object.eventConfig); + } + if (object.textClassificationConfig != null) { + if (typeof object.textClassificationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.textClassificationConfig: object expected"); + message.textClassificationConfig = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.fromObject(object.textClassificationConfig); + } + if (object.textEntityExtractionConfig != null) { + if (typeof object.textEntityExtractionConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.textEntityExtractionConfig: object expected"); + message.textEntityExtractionConfig = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.fromObject(object.textEntityExtractionConfig); + } + if (object.humanAnnotationConfig != null) { + if (typeof object.humanAnnotationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.humanAnnotationConfig: object expected"); + message.humanAnnotationConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.humanAnnotationConfig); + } + return message; + }; + + /** + * Creates a plain object from an AnnotatedDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata} message AnnotatedDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotatedDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.humanAnnotationConfig = null; + if (message.humanAnnotationConfig != null && message.hasOwnProperty("humanAnnotationConfig")) + object.humanAnnotationConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.humanAnnotationConfig, options); + if (message.imageClassificationConfig != null && message.hasOwnProperty("imageClassificationConfig")) { + object.imageClassificationConfig = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.toObject(message.imageClassificationConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "imageClassificationConfig"; + } + if (message.boundingPolyConfig != null && message.hasOwnProperty("boundingPolyConfig")) { + object.boundingPolyConfig = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.toObject(message.boundingPolyConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "boundingPolyConfig"; + } + if (message.polylineConfig != null && message.hasOwnProperty("polylineConfig")) { + object.polylineConfig = $root.google.cloud.datalabeling.v1beta1.PolylineConfig.toObject(message.polylineConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "polylineConfig"; + } + if (message.segmentationConfig != null && message.hasOwnProperty("segmentationConfig")) { + object.segmentationConfig = $root.google.cloud.datalabeling.v1beta1.SegmentationConfig.toObject(message.segmentationConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "segmentationConfig"; + } + if (message.videoClassificationConfig != null && message.hasOwnProperty("videoClassificationConfig")) { + object.videoClassificationConfig = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.toObject(message.videoClassificationConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "videoClassificationConfig"; + } + if (message.objectDetectionConfig != null && message.hasOwnProperty("objectDetectionConfig")) { + object.objectDetectionConfig = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.toObject(message.objectDetectionConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "objectDetectionConfig"; + } + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) { + object.objectTrackingConfig = $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.toObject(message.objectTrackingConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "objectTrackingConfig"; + } + if (message.eventConfig != null && message.hasOwnProperty("eventConfig")) { + object.eventConfig = $root.google.cloud.datalabeling.v1beta1.EventConfig.toObject(message.eventConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "eventConfig"; + } + if (message.textClassificationConfig != null && message.hasOwnProperty("textClassificationConfig")) { + object.textClassificationConfig = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.toObject(message.textClassificationConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "textClassificationConfig"; + } + if (message.textEntityExtractionConfig != null && message.hasOwnProperty("textEntityExtractionConfig")) { + object.textEntityExtractionConfig = $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.toObject(message.textEntityExtractionConfig, options); + if (options.oneofs) + object.annotationRequestConfig = "textEntityExtractionConfig"; + } + return object; + }; + + /** + * Converts this AnnotatedDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + AnnotatedDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotatedDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotatedDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata"; + }; + + return AnnotatedDatasetMetadata; + })(); + + v1beta1.Example = (function() { + + /** + * Properties of an Example. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IExample + * @property {google.cloud.datalabeling.v1beta1.IImagePayload|null} [imagePayload] Example imagePayload + * @property {google.cloud.datalabeling.v1beta1.ITextPayload|null} [textPayload] Example textPayload + * @property {google.cloud.datalabeling.v1beta1.IVideoPayload|null} [videoPayload] Example videoPayload + * @property {string|null} [name] Example name + * @property {Array.|null} [annotations] Example annotations + */ + + /** + * Constructs a new Example. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an Example. + * @implements IExample + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IExample=} [properties] Properties to set + */ + function Example(properties) { + this.annotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Example imagePayload. + * @member {google.cloud.datalabeling.v1beta1.IImagePayload|null|undefined} imagePayload + * @memberof google.cloud.datalabeling.v1beta1.Example + * @instance + */ + Example.prototype.imagePayload = null; + + /** + * Example textPayload. + * @member {google.cloud.datalabeling.v1beta1.ITextPayload|null|undefined} textPayload + * @memberof google.cloud.datalabeling.v1beta1.Example + * @instance + */ + Example.prototype.textPayload = null; + + /** + * Example videoPayload. + * @member {google.cloud.datalabeling.v1beta1.IVideoPayload|null|undefined} videoPayload + * @memberof google.cloud.datalabeling.v1beta1.Example + * @instance + */ + Example.prototype.videoPayload = null; + + /** + * Example name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.Example + * @instance + */ + Example.prototype.name = ""; + + /** + * Example annotations. + * @member {Array.} annotations + * @memberof google.cloud.datalabeling.v1beta1.Example + * @instance + */ + Example.prototype.annotations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Example payload. + * @member {"imagePayload"|"textPayload"|"videoPayload"|undefined} payload + * @memberof google.cloud.datalabeling.v1beta1.Example + * @instance + */ + Object.defineProperty(Example.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["imagePayload", "textPayload", "videoPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Example instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.Example + * @static + * @param {google.cloud.datalabeling.v1beta1.IExample=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.Example} Example instance + */ + Example.create = function create(properties) { + return new Example(properties); + }; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Example.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.Example + * @static + * @param {google.cloud.datalabeling.v1beta1.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.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.imagePayload != null && Object.hasOwnProperty.call(message, "imagePayload")) + $root.google.cloud.datalabeling.v1beta1.ImagePayload.encode(message.imagePayload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.annotations != null && message.annotations.length) + for (var i = 0; i < message.annotations.length; ++i) + $root.google.cloud.datalabeling.v1beta1.Annotation.encode(message.annotations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.textPayload != null && Object.hasOwnProperty.call(message, "textPayload")) + $root.google.cloud.datalabeling.v1beta1.TextPayload.encode(message.textPayload, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.videoPayload != null && Object.hasOwnProperty.call(message, "videoPayload")) + $root.google.cloud.datalabeling.v1beta1.VideoPayload.encode(message.videoPayload, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Example.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Example + * @static + * @param {google.cloud.datalabeling.v1beta1.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Example message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.Example(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.imagePayload = $root.google.cloud.datalabeling.v1beta1.ImagePayload.decode(reader, reader.uint32()); + break; + } + case 6: { + message.textPayload = $root.google.cloud.datalabeling.v1beta1.TextPayload.decode(reader, reader.uint32()); + break; + } + case 7: { + message.videoPayload = $root.google.cloud.datalabeling.v1beta1.VideoPayload.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 5: { + if (!(message.annotations && message.annotations.length)) + message.annotations = []; + message.annotations.push($root.google.cloud.datalabeling.v1beta1.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Example message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.Example + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Example.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imagePayload != null && message.hasOwnProperty("imagePayload")) { + properties.payload = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ImagePayload.verify(message.imagePayload); + if (error) + return "imagePayload." + error; + } + } + if (message.textPayload != null && message.hasOwnProperty("textPayload")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextPayload.verify(message.textPayload); + if (error) + return "textPayload." + error; + } + } + if (message.videoPayload != null && message.hasOwnProperty("videoPayload")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.VideoPayload.verify(message.videoPayload); + if (error) + return "videoPayload." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!Array.isArray(message.annotations)) + return "annotations: array expected"; + for (var i = 0; i < message.annotations.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.Annotation.verify(message.annotations[i]); + if (error) + return "annotations." + error; + } + } + return null; + }; + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.Example + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.Example} Example + */ + Example.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.Example) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.Example(); + if (object.imagePayload != null) { + if (typeof object.imagePayload !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Example.imagePayload: object expected"); + message.imagePayload = $root.google.cloud.datalabeling.v1beta1.ImagePayload.fromObject(object.imagePayload); + } + if (object.textPayload != null) { + if (typeof object.textPayload !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Example.textPayload: object expected"); + message.textPayload = $root.google.cloud.datalabeling.v1beta1.TextPayload.fromObject(object.textPayload); + } + if (object.videoPayload != null) { + if (typeof object.videoPayload !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Example.videoPayload: object expected"); + message.videoPayload = $root.google.cloud.datalabeling.v1beta1.VideoPayload.fromObject(object.videoPayload); + } + if (object.name != null) + message.name = String(object.name); + if (object.annotations) { + if (!Array.isArray(object.annotations)) + throw TypeError(".google.cloud.datalabeling.v1beta1.Example.annotations: array expected"); + message.annotations = []; + for (var i = 0; i < object.annotations.length; ++i) { + if (typeof object.annotations[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Example.annotations: object expected"); + message.annotations[i] = $root.google.cloud.datalabeling.v1beta1.Annotation.fromObject(object.annotations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.Example + * @static + * @param {google.cloud.datalabeling.v1beta1.Example} message Example + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Example.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotations = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.imagePayload != null && message.hasOwnProperty("imagePayload")) { + object.imagePayload = $root.google.cloud.datalabeling.v1beta1.ImagePayload.toObject(message.imagePayload, options); + if (options.oneofs) + object.payload = "imagePayload"; + } + if (message.annotations && message.annotations.length) { + object.annotations = []; + for (var j = 0; j < message.annotations.length; ++j) + object.annotations[j] = $root.google.cloud.datalabeling.v1beta1.Annotation.toObject(message.annotations[j], options); + } + if (message.textPayload != null && message.hasOwnProperty("textPayload")) { + object.textPayload = $root.google.cloud.datalabeling.v1beta1.TextPayload.toObject(message.textPayload, options); + if (options.oneofs) + object.payload = "textPayload"; + } + if (message.videoPayload != null && message.hasOwnProperty("videoPayload")) { + object.videoPayload = $root.google.cloud.datalabeling.v1beta1.VideoPayload.toObject(message.videoPayload, options); + if (options.oneofs) + object.payload = "videoPayload"; + } + return object; + }; + + /** + * Converts this Example to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.Example + * @instance + * @returns {Object.} JSON object + */ + Example.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Example + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.Example + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.Example"; + }; + + return Example; + })(); + + v1beta1.ImagePayload = (function() { + + /** + * Properties of an ImagePayload. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IImagePayload + * @property {string|null} [mimeType] ImagePayload mimeType + * @property {Uint8Array|null} [imageThumbnail] ImagePayload imageThumbnail + * @property {string|null} [imageUri] ImagePayload imageUri + * @property {string|null} [signedUri] ImagePayload signedUri + */ + + /** + * Constructs a new ImagePayload. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ImagePayload. + * @implements IImagePayload + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IImagePayload=} [properties] Properties to set + */ + function ImagePayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImagePayload mimeType. + * @member {string} mimeType + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @instance + */ + ImagePayload.prototype.mimeType = ""; + + /** + * ImagePayload imageThumbnail. + * @member {Uint8Array} imageThumbnail + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @instance + */ + ImagePayload.prototype.imageThumbnail = $util.newBuffer([]); + + /** + * ImagePayload imageUri. + * @member {string} imageUri + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @instance + */ + ImagePayload.prototype.imageUri = ""; + + /** + * ImagePayload signedUri. + * @member {string} signedUri + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @instance + */ + ImagePayload.prototype.signedUri = ""; + + /** + * Creates a new ImagePayload instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @static + * @param {google.cloud.datalabeling.v1beta1.IImagePayload=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ImagePayload} ImagePayload instance + */ + ImagePayload.create = function create(properties) { + return new ImagePayload(properties); + }; + + /** + * Encodes the specified ImagePayload message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImagePayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @static + * @param {google.cloud.datalabeling.v1beta1.IImagePayload} message ImagePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImagePayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.imageThumbnail != null && Object.hasOwnProperty.call(message, "imageThumbnail")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.imageThumbnail); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); + if (message.signedUri != null && Object.hasOwnProperty.call(message, "signedUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.signedUri); + return writer; + }; + + /** + * Encodes the specified ImagePayload message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImagePayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @static + * @param {google.cloud.datalabeling.v1beta1.IImagePayload} message ImagePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImagePayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImagePayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ImagePayload} ImagePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImagePayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ImagePayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.imageThumbnail = reader.bytes(); + break; + } + case 3: { + message.imageUri = reader.string(); + break; + } + case 4: { + message.signedUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImagePayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ImagePayload} ImagePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImagePayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImagePayload message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImagePayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.imageThumbnail != null && message.hasOwnProperty("imageThumbnail")) + if (!(message.imageThumbnail && typeof message.imageThumbnail.length === "number" || $util.isString(message.imageThumbnail))) + return "imageThumbnail: buffer expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.signedUri != null && message.hasOwnProperty("signedUri")) + if (!$util.isString(message.signedUri)) + return "signedUri: string expected"; + return null; + }; + + /** + * Creates an ImagePayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ImagePayload} ImagePayload + */ + ImagePayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ImagePayload) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ImagePayload(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.imageThumbnail != null) + if (typeof object.imageThumbnail === "string") + $util.base64.decode(object.imageThumbnail, message.imageThumbnail = $util.newBuffer($util.base64.length(object.imageThumbnail)), 0); + else if (object.imageThumbnail.length >= 0) + message.imageThumbnail = object.imageThumbnail; + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.signedUri != null) + message.signedUri = String(object.signedUri); + return message; + }; + + /** + * Creates a plain object from an ImagePayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @static + * @param {google.cloud.datalabeling.v1beta1.ImagePayload} message ImagePayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImagePayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + if (options.bytes === String) + object.imageThumbnail = ""; + else { + object.imageThumbnail = []; + if (options.bytes !== Array) + object.imageThumbnail = $util.newBuffer(object.imageThumbnail); + } + object.imageUri = ""; + object.signedUri = ""; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.imageThumbnail != null && message.hasOwnProperty("imageThumbnail")) + object.imageThumbnail = options.bytes === String ? $util.base64.encode(message.imageThumbnail, 0, message.imageThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.imageThumbnail) : message.imageThumbnail; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.signedUri != null && message.hasOwnProperty("signedUri")) + object.signedUri = message.signedUri; + return object; + }; + + /** + * Converts this ImagePayload to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @instance + * @returns {Object.} JSON object + */ + ImagePayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImagePayload + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ImagePayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImagePayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ImagePayload"; + }; + + return ImagePayload; + })(); + + v1beta1.TextPayload = (function() { + + /** + * Properties of a TextPayload. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ITextPayload + * @property {string|null} [textContent] TextPayload textContent + */ + + /** + * Constructs a new TextPayload. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a TextPayload. + * @implements ITextPayload + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ITextPayload=} [properties] Properties to set + */ + function TextPayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextPayload textContent. + * @member {string} textContent + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @instance + */ + TextPayload.prototype.textContent = ""; + + /** + * Creates a new TextPayload instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextPayload=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.TextPayload} TextPayload instance + */ + TextPayload.create = function create(properties) { + return new TextPayload(properties); + }; + + /** + * Encodes the specified TextPayload message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextPayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextPayload} message TextPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextPayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textContent != null && Object.hasOwnProperty.call(message, "textContent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textContent); + return writer; + }; + + /** + * Encodes the specified TextPayload message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextPayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextPayload} message TextPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextPayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextPayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.TextPayload} TextPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextPayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.TextPayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textContent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextPayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.TextPayload} TextPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextPayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextPayload message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextPayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textContent != null && message.hasOwnProperty("textContent")) + if (!$util.isString(message.textContent)) + return "textContent: string expected"; + return null; + }; + + /** + * Creates a TextPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.TextPayload} TextPayload + */ + TextPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.TextPayload) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.TextPayload(); + if (object.textContent != null) + message.textContent = String(object.textContent); + return message; + }; + + /** + * Creates a plain object from a TextPayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @static + * @param {google.cloud.datalabeling.v1beta1.TextPayload} message TextPayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextPayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.textContent = ""; + if (message.textContent != null && message.hasOwnProperty("textContent")) + object.textContent = message.textContent; + return object; + }; + + /** + * Converts this TextPayload to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @instance + * @returns {Object.} JSON object + */ + TextPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextPayload + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.TextPayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.TextPayload"; + }; + + return TextPayload; + })(); + + v1beta1.VideoThumbnail = (function() { + + /** + * Properties of a VideoThumbnail. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IVideoThumbnail + * @property {Uint8Array|null} [thumbnail] VideoThumbnail thumbnail + * @property {google.protobuf.IDuration|null} [timeOffset] VideoThumbnail timeOffset + */ + + /** + * Constructs a new VideoThumbnail. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a VideoThumbnail. + * @implements IVideoThumbnail + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IVideoThumbnail=} [properties] Properties to set + */ + function VideoThumbnail(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoThumbnail thumbnail. + * @member {Uint8Array} thumbnail + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @instance + */ + VideoThumbnail.prototype.thumbnail = $util.newBuffer([]); + + /** + * VideoThumbnail timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @instance + */ + VideoThumbnail.prototype.timeOffset = null; + + /** + * Creates a new VideoThumbnail instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoThumbnail=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.VideoThumbnail} VideoThumbnail instance + */ + VideoThumbnail.create = function create(properties) { + return new VideoThumbnail(properties); + }; + + /** + * Encodes the specified VideoThumbnail message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoThumbnail.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoThumbnail} message VideoThumbnail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoThumbnail.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.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 VideoThumbnail message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoThumbnail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoThumbnail} message VideoThumbnail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoThumbnail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoThumbnail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.VideoThumbnail} VideoThumbnail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoThumbnail.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.VideoThumbnail(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.thumbnail = reader.bytes(); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoThumbnail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.VideoThumbnail} VideoThumbnail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoThumbnail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoThumbnail message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoThumbnail.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.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + return null; + }; + + /** + * Creates a VideoThumbnail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.VideoThumbnail} VideoThumbnail + */ + VideoThumbnail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.VideoThumbnail) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.VideoThumbnail(); + 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.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoThumbnail.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + return message; + }; + + /** + * Creates a plain object from a VideoThumbnail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoThumbnail} message VideoThumbnail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoThumbnail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.thumbnail = ""; + else { + object.thumbnail = []; + if (options.bytes !== Array) + object.thumbnail = $util.newBuffer(object.thumbnail); + } + object.timeOffset = null; + } + 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.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + return object; + }; + + /** + * Converts this VideoThumbnail to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @instance + * @returns {Object.} JSON object + */ + VideoThumbnail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoThumbnail + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.VideoThumbnail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoThumbnail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.VideoThumbnail"; + }; + + return VideoThumbnail; + })(); + + v1beta1.VideoPayload = (function() { + + /** + * Properties of a VideoPayload. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IVideoPayload + * @property {string|null} [mimeType] VideoPayload mimeType + * @property {string|null} [videoUri] VideoPayload videoUri + * @property {Array.|null} [videoThumbnails] VideoPayload videoThumbnails + * @property {number|null} [frameRate] VideoPayload frameRate + * @property {string|null} [signedUri] VideoPayload signedUri + */ + + /** + * Constructs a new VideoPayload. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a VideoPayload. + * @implements IVideoPayload + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IVideoPayload=} [properties] Properties to set + */ + function VideoPayload(properties) { + this.videoThumbnails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoPayload mimeType. + * @member {string} mimeType + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @instance + */ + VideoPayload.prototype.mimeType = ""; + + /** + * VideoPayload videoUri. + * @member {string} videoUri + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @instance + */ + VideoPayload.prototype.videoUri = ""; + + /** + * VideoPayload videoThumbnails. + * @member {Array.} videoThumbnails + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @instance + */ + VideoPayload.prototype.videoThumbnails = $util.emptyArray; + + /** + * VideoPayload frameRate. + * @member {number} frameRate + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @instance + */ + VideoPayload.prototype.frameRate = 0; + + /** + * VideoPayload signedUri. + * @member {string} signedUri + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @instance + */ + VideoPayload.prototype.signedUri = ""; + + /** + * Creates a new VideoPayload instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoPayload=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.VideoPayload} VideoPayload instance + */ + VideoPayload.create = function create(properties) { + return new VideoPayload(properties); + }; + + /** + * Encodes the specified VideoPayload message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoPayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoPayload} message VideoPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoPayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.videoUri != null && Object.hasOwnProperty.call(message, "videoUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.videoUri); + if (message.videoThumbnails != null && message.videoThumbnails.length) + for (var i = 0; i < message.videoThumbnails.length; ++i) + $root.google.cloud.datalabeling.v1beta1.VideoThumbnail.encode(message.videoThumbnails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frameRate != null && Object.hasOwnProperty.call(message, "frameRate")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.frameRate); + if (message.signedUri != null && Object.hasOwnProperty.call(message, "signedUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.signedUri); + return writer; + }; + + /** + * Encodes the specified VideoPayload message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoPayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoPayload} message VideoPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoPayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoPayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.VideoPayload} VideoPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoPayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.VideoPayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.videoUri = reader.string(); + break; + } + case 3: { + if (!(message.videoThumbnails && message.videoThumbnails.length)) + message.videoThumbnails = []; + message.videoThumbnails.push($root.google.cloud.datalabeling.v1beta1.VideoThumbnail.decode(reader, reader.uint32())); + break; + } + case 4: { + message.frameRate = reader.float(); + break; + } + case 5: { + message.signedUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoPayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.VideoPayload} VideoPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoPayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoPayload message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoPayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.videoUri != null && message.hasOwnProperty("videoUri")) + if (!$util.isString(message.videoUri)) + return "videoUri: string expected"; + if (message.videoThumbnails != null && message.hasOwnProperty("videoThumbnails")) { + if (!Array.isArray(message.videoThumbnails)) + return "videoThumbnails: array expected"; + for (var i = 0; i < message.videoThumbnails.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.VideoThumbnail.verify(message.videoThumbnails[i]); + if (error) + return "videoThumbnails." + error; + } + } + if (message.frameRate != null && message.hasOwnProperty("frameRate")) + if (typeof message.frameRate !== "number") + return "frameRate: number expected"; + if (message.signedUri != null && message.hasOwnProperty("signedUri")) + if (!$util.isString(message.signedUri)) + return "signedUri: string expected"; + return null; + }; + + /** + * Creates a VideoPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.VideoPayload} VideoPayload + */ + VideoPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.VideoPayload) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.VideoPayload(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.videoUri != null) + message.videoUri = String(object.videoUri); + if (object.videoThumbnails) { + if (!Array.isArray(object.videoThumbnails)) + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoPayload.videoThumbnails: array expected"); + message.videoThumbnails = []; + for (var i = 0; i < object.videoThumbnails.length; ++i) { + if (typeof object.videoThumbnails[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoPayload.videoThumbnails: object expected"); + message.videoThumbnails[i] = $root.google.cloud.datalabeling.v1beta1.VideoThumbnail.fromObject(object.videoThumbnails[i]); + } + } + if (object.frameRate != null) + message.frameRate = Number(object.frameRate); + if (object.signedUri != null) + message.signedUri = String(object.signedUri); + return message; + }; + + /** + * Creates a plain object from a VideoPayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoPayload} message VideoPayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoPayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.videoThumbnails = []; + if (options.defaults) { + object.mimeType = ""; + object.videoUri = ""; + object.frameRate = 0; + object.signedUri = ""; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.videoUri != null && message.hasOwnProperty("videoUri")) + object.videoUri = message.videoUri; + if (message.videoThumbnails && message.videoThumbnails.length) { + object.videoThumbnails = []; + for (var j = 0; j < message.videoThumbnails.length; ++j) + object.videoThumbnails[j] = $root.google.cloud.datalabeling.v1beta1.VideoThumbnail.toObject(message.videoThumbnails[j], options); + } + if (message.frameRate != null && message.hasOwnProperty("frameRate")) + object.frameRate = options.json && !isFinite(message.frameRate) ? String(message.frameRate) : message.frameRate; + if (message.signedUri != null && message.hasOwnProperty("signedUri")) + object.signedUri = message.signedUri; + return object; + }; + + /** + * Converts this VideoPayload to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @instance + * @returns {Object.} JSON object + */ + VideoPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoPayload + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.VideoPayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.VideoPayload"; + }; + + return VideoPayload; + })(); + + /** + * StringAggregationType enum. + * @name google.cloud.datalabeling.v1beta1.StringAggregationType + * @enum {number} + * @property {number} STRING_AGGREGATION_TYPE_UNSPECIFIED=0 STRING_AGGREGATION_TYPE_UNSPECIFIED value + * @property {number} MAJORITY_VOTE=1 MAJORITY_VOTE value + * @property {number} UNANIMOUS_VOTE=2 UNANIMOUS_VOTE value + * @property {number} NO_AGGREGATION=3 NO_AGGREGATION value + */ + v1beta1.StringAggregationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING_AGGREGATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MAJORITY_VOTE"] = 1; + values[valuesById[2] = "UNANIMOUS_VOTE"] = 2; + values[valuesById[3] = "NO_AGGREGATION"] = 3; + return values; + })(); + + v1beta1.HumanAnnotationConfig = (function() { + + /** + * Properties of a HumanAnnotationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IHumanAnnotationConfig + * @property {string|null} [instruction] HumanAnnotationConfig instruction + * @property {string|null} [annotatedDatasetDisplayName] HumanAnnotationConfig annotatedDatasetDisplayName + * @property {string|null} [annotatedDatasetDescription] HumanAnnotationConfig annotatedDatasetDescription + * @property {string|null} [labelGroup] HumanAnnotationConfig labelGroup + * @property {string|null} [languageCode] HumanAnnotationConfig languageCode + * @property {number|null} [replicaCount] HumanAnnotationConfig replicaCount + * @property {google.protobuf.IDuration|null} [questionDuration] HumanAnnotationConfig questionDuration + * @property {Array.|null} [contributorEmails] HumanAnnotationConfig contributorEmails + * @property {string|null} [userEmailAddress] HumanAnnotationConfig userEmailAddress + */ + + /** + * Constructs a new HumanAnnotationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a HumanAnnotationConfig. + * @implements IHumanAnnotationConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig=} [properties] Properties to set + */ + function HumanAnnotationConfig(properties) { + this.contributorEmails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HumanAnnotationConfig instruction. + * @member {string} instruction + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + */ + HumanAnnotationConfig.prototype.instruction = ""; + + /** + * HumanAnnotationConfig annotatedDatasetDisplayName. + * @member {string} annotatedDatasetDisplayName + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + */ + HumanAnnotationConfig.prototype.annotatedDatasetDisplayName = ""; + + /** + * HumanAnnotationConfig annotatedDatasetDescription. + * @member {string} annotatedDatasetDescription + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + */ + HumanAnnotationConfig.prototype.annotatedDatasetDescription = ""; + + /** + * HumanAnnotationConfig labelGroup. + * @member {string} labelGroup + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + */ + HumanAnnotationConfig.prototype.labelGroup = ""; + + /** + * HumanAnnotationConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + */ + HumanAnnotationConfig.prototype.languageCode = ""; + + /** + * HumanAnnotationConfig replicaCount. + * @member {number} replicaCount + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + */ + HumanAnnotationConfig.prototype.replicaCount = 0; + + /** + * HumanAnnotationConfig questionDuration. + * @member {google.protobuf.IDuration|null|undefined} questionDuration + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + */ + HumanAnnotationConfig.prototype.questionDuration = null; + + /** + * HumanAnnotationConfig contributorEmails. + * @member {Array.} contributorEmails + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + */ + HumanAnnotationConfig.prototype.contributorEmails = $util.emptyArray; + + /** + * HumanAnnotationConfig userEmailAddress. + * @member {string} userEmailAddress + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + */ + HumanAnnotationConfig.prototype.userEmailAddress = ""; + + /** + * Creates a new HumanAnnotationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.HumanAnnotationConfig} HumanAnnotationConfig instance + */ + HumanAnnotationConfig.create = function create(properties) { + return new HumanAnnotationConfig(properties); + }; + + /** + * Encodes the specified HumanAnnotationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig} message HumanAnnotationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanAnnotationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instruction); + if (message.annotatedDatasetDisplayName != null && Object.hasOwnProperty.call(message, "annotatedDatasetDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.annotatedDatasetDisplayName); + if (message.annotatedDatasetDescription != null && Object.hasOwnProperty.call(message, "annotatedDatasetDescription")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.annotatedDatasetDescription); + if (message.labelGroup != null && Object.hasOwnProperty.call(message, "labelGroup")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.labelGroup); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + if (message.replicaCount != null && Object.hasOwnProperty.call(message, "replicaCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.replicaCount); + if (message.questionDuration != null && Object.hasOwnProperty.call(message, "questionDuration")) + $root.google.protobuf.Duration.encode(message.questionDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.contributorEmails != null && message.contributorEmails.length) + for (var i = 0; i < message.contributorEmails.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.contributorEmails[i]); + if (message.userEmailAddress != null && Object.hasOwnProperty.call(message, "userEmailAddress")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.userEmailAddress); + return writer; + }; + + /** + * Encodes the specified HumanAnnotationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig} message HumanAnnotationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanAnnotationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HumanAnnotationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.HumanAnnotationConfig} HumanAnnotationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanAnnotationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instruction = reader.string(); + break; + } + case 2: { + message.annotatedDatasetDisplayName = reader.string(); + break; + } + case 3: { + message.annotatedDatasetDescription = reader.string(); + break; + } + case 4: { + message.labelGroup = reader.string(); + break; + } + case 5: { + message.languageCode = reader.string(); + break; + } + case 6: { + message.replicaCount = reader.int32(); + break; + } + case 7: { + message.questionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.contributorEmails && message.contributorEmails.length)) + message.contributorEmails = []; + message.contributorEmails.push(reader.string()); + break; + } + case 10: { + message.userEmailAddress = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HumanAnnotationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.HumanAnnotationConfig} HumanAnnotationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanAnnotationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HumanAnnotationConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HumanAnnotationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instruction != null && message.hasOwnProperty("instruction")) + if (!$util.isString(message.instruction)) + return "instruction: string expected"; + if (message.annotatedDatasetDisplayName != null && message.hasOwnProperty("annotatedDatasetDisplayName")) + if (!$util.isString(message.annotatedDatasetDisplayName)) + return "annotatedDatasetDisplayName: string expected"; + if (message.annotatedDatasetDescription != null && message.hasOwnProperty("annotatedDatasetDescription")) + if (!$util.isString(message.annotatedDatasetDescription)) + return "annotatedDatasetDescription: string expected"; + if (message.labelGroup != null && message.hasOwnProperty("labelGroup")) + if (!$util.isString(message.labelGroup)) + return "labelGroup: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.replicaCount != null && message.hasOwnProperty("replicaCount")) + if (!$util.isInteger(message.replicaCount)) + return "replicaCount: integer expected"; + if (message.questionDuration != null && message.hasOwnProperty("questionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.questionDuration); + if (error) + return "questionDuration." + error; + } + if (message.contributorEmails != null && message.hasOwnProperty("contributorEmails")) { + if (!Array.isArray(message.contributorEmails)) + return "contributorEmails: array expected"; + for (var i = 0; i < message.contributorEmails.length; ++i) + if (!$util.isString(message.contributorEmails[i])) + return "contributorEmails: string[] expected"; + } + if (message.userEmailAddress != null && message.hasOwnProperty("userEmailAddress")) + if (!$util.isString(message.userEmailAddress)) + return "userEmailAddress: string expected"; + return null; + }; + + /** + * Creates a HumanAnnotationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.HumanAnnotationConfig} HumanAnnotationConfig + */ + HumanAnnotationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig(); + if (object.instruction != null) + message.instruction = String(object.instruction); + if (object.annotatedDatasetDisplayName != null) + message.annotatedDatasetDisplayName = String(object.annotatedDatasetDisplayName); + if (object.annotatedDatasetDescription != null) + message.annotatedDatasetDescription = String(object.annotatedDatasetDescription); + if (object.labelGroup != null) + message.labelGroup = String(object.labelGroup); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.replicaCount != null) + message.replicaCount = object.replicaCount | 0; + if (object.questionDuration != null) { + if (typeof object.questionDuration !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.questionDuration: object expected"); + message.questionDuration = $root.google.protobuf.Duration.fromObject(object.questionDuration); + } + if (object.contributorEmails) { + if (!Array.isArray(object.contributorEmails)) + throw TypeError(".google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.contributorEmails: array expected"); + message.contributorEmails = []; + for (var i = 0; i < object.contributorEmails.length; ++i) + message.contributorEmails[i] = String(object.contributorEmails[i]); + } + if (object.userEmailAddress != null) + message.userEmailAddress = String(object.userEmailAddress); + return message; + }; + + /** + * Creates a plain object from a HumanAnnotationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.HumanAnnotationConfig} message HumanAnnotationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HumanAnnotationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contributorEmails = []; + if (options.defaults) { + object.instruction = ""; + object.annotatedDatasetDisplayName = ""; + object.annotatedDatasetDescription = ""; + object.labelGroup = ""; + object.languageCode = ""; + object.replicaCount = 0; + object.questionDuration = null; + object.userEmailAddress = ""; + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = message.instruction; + if (message.annotatedDatasetDisplayName != null && message.hasOwnProperty("annotatedDatasetDisplayName")) + object.annotatedDatasetDisplayName = message.annotatedDatasetDisplayName; + if (message.annotatedDatasetDescription != null && message.hasOwnProperty("annotatedDatasetDescription")) + object.annotatedDatasetDescription = message.annotatedDatasetDescription; + if (message.labelGroup != null && message.hasOwnProperty("labelGroup")) + object.labelGroup = message.labelGroup; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.replicaCount != null && message.hasOwnProperty("replicaCount")) + object.replicaCount = message.replicaCount; + if (message.questionDuration != null && message.hasOwnProperty("questionDuration")) + object.questionDuration = $root.google.protobuf.Duration.toObject(message.questionDuration, options); + if (message.contributorEmails && message.contributorEmails.length) { + object.contributorEmails = []; + for (var j = 0; j < message.contributorEmails.length; ++j) + object.contributorEmails[j] = message.contributorEmails[j]; + } + if (message.userEmailAddress != null && message.hasOwnProperty("userEmailAddress")) + object.userEmailAddress = message.userEmailAddress; + return object; + }; + + /** + * Converts this HumanAnnotationConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @instance + * @returns {Object.} JSON object + */ + HumanAnnotationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HumanAnnotationConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.HumanAnnotationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HumanAnnotationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"; + }; + + return HumanAnnotationConfig; + })(); + + v1beta1.ImageClassificationConfig = (function() { + + /** + * Properties of an ImageClassificationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IImageClassificationConfig + * @property {string|null} [annotationSpecSet] ImageClassificationConfig annotationSpecSet + * @property {boolean|null} [allowMultiLabel] ImageClassificationConfig allowMultiLabel + * @property {google.cloud.datalabeling.v1beta1.StringAggregationType|null} [answerAggregationType] ImageClassificationConfig answerAggregationType + */ + + /** + * Constructs a new ImageClassificationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ImageClassificationConfig. + * @implements IImageClassificationConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IImageClassificationConfig=} [properties] Properties to set + */ + function ImageClassificationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationConfig annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @instance + */ + ImageClassificationConfig.prototype.annotationSpecSet = ""; + + /** + * ImageClassificationConfig allowMultiLabel. + * @member {boolean} allowMultiLabel + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @instance + */ + ImageClassificationConfig.prototype.allowMultiLabel = false; + + /** + * ImageClassificationConfig answerAggregationType. + * @member {google.cloud.datalabeling.v1beta1.StringAggregationType} answerAggregationType + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @instance + */ + ImageClassificationConfig.prototype.answerAggregationType = 0; + + /** + * Creates a new ImageClassificationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageClassificationConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ImageClassificationConfig} ImageClassificationConfig instance + */ + ImageClassificationConfig.create = function create(properties) { + return new ImageClassificationConfig(properties); + }; + + /** + * Encodes the specified ImageClassificationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageClassificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageClassificationConfig} message ImageClassificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecSet); + if (message.allowMultiLabel != null && Object.hasOwnProperty.call(message, "allowMultiLabel")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowMultiLabel); + if (message.answerAggregationType != null && Object.hasOwnProperty.call(message, "answerAggregationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.answerAggregationType); + return writer; + }; + + /** + * Encodes the specified ImageClassificationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImageClassificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IImageClassificationConfig} message ImageClassificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ImageClassificationConfig} ImageClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpecSet = reader.string(); + break; + } + case 2: { + message.allowMultiLabel = reader.bool(); + break; + } + case 3: { + message.answerAggregationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ImageClassificationConfig} ImageClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: string expected"; + if (message.allowMultiLabel != null && message.hasOwnProperty("allowMultiLabel")) + if (typeof message.allowMultiLabel !== "boolean") + return "allowMultiLabel: boolean expected"; + if (message.answerAggregationType != null && message.hasOwnProperty("answerAggregationType")) + switch (message.answerAggregationType) { + default: + return "answerAggregationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an ImageClassificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ImageClassificationConfig} ImageClassificationConfig + */ + ImageClassificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig(); + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + if (object.allowMultiLabel != null) + message.allowMultiLabel = Boolean(object.allowMultiLabel); + switch (object.answerAggregationType) { + default: + if (typeof object.answerAggregationType === "number") { + message.answerAggregationType = object.answerAggregationType; + break; + } + break; + case "STRING_AGGREGATION_TYPE_UNSPECIFIED": + case 0: + message.answerAggregationType = 0; + break; + case "MAJORITY_VOTE": + case 1: + message.answerAggregationType = 1; + break; + case "UNANIMOUS_VOTE": + case 2: + message.answerAggregationType = 2; + break; + case "NO_AGGREGATION": + case 3: + message.answerAggregationType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImageClassificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ImageClassificationConfig} message ImageClassificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecSet = ""; + object.allowMultiLabel = false; + object.answerAggregationType = options.enums === String ? "STRING_AGGREGATION_TYPE_UNSPECIFIED" : 0; + } + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + if (message.allowMultiLabel != null && message.hasOwnProperty("allowMultiLabel")) + object.allowMultiLabel = message.allowMultiLabel; + if (message.answerAggregationType != null && message.hasOwnProperty("answerAggregationType")) + object.answerAggregationType = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.StringAggregationType[message.answerAggregationType] === undefined ? message.answerAggregationType : $root.google.cloud.datalabeling.v1beta1.StringAggregationType[message.answerAggregationType] : message.answerAggregationType; + return object; + }; + + /** + * Converts this ImageClassificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ImageClassificationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ImageClassificationConfig"; + }; + + return ImageClassificationConfig; + })(); + + v1beta1.BoundingPolyConfig = (function() { + + /** + * Properties of a BoundingPolyConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IBoundingPolyConfig + * @property {string|null} [annotationSpecSet] BoundingPolyConfig annotationSpecSet + * @property {string|null} [instructionMessage] BoundingPolyConfig instructionMessage + */ + + /** + * Constructs a new BoundingPolyConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a BoundingPolyConfig. + * @implements IBoundingPolyConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig=} [properties] Properties to set + */ + function BoundingPolyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingPolyConfig annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @instance + */ + BoundingPolyConfig.prototype.annotationSpecSet = ""; + + /** + * BoundingPolyConfig instructionMessage. + * @member {string} instructionMessage + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @instance + */ + BoundingPolyConfig.prototype.instructionMessage = ""; + + /** + * Creates a new BoundingPolyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.BoundingPolyConfig} BoundingPolyConfig instance + */ + BoundingPolyConfig.create = function create(properties) { + return new BoundingPolyConfig(properties); + }; + + /** + * Encodes the specified BoundingPolyConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingPolyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig} message BoundingPolyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPolyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecSet); + if (message.instructionMessage != null && Object.hasOwnProperty.call(message, "instructionMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instructionMessage); + return writer; + }; + + /** + * Encodes the specified BoundingPolyConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingPolyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig} message BoundingPolyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPolyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingPolyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.BoundingPolyConfig} BoundingPolyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPolyConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpecSet = reader.string(); + break; + } + case 2: { + message.instructionMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingPolyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.BoundingPolyConfig} BoundingPolyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPolyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingPolyConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingPolyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: string expected"; + if (message.instructionMessage != null && message.hasOwnProperty("instructionMessage")) + if (!$util.isString(message.instructionMessage)) + return "instructionMessage: string expected"; + return null; + }; + + /** + * Creates a BoundingPolyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.BoundingPolyConfig} BoundingPolyConfig + */ + BoundingPolyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig(); + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + if (object.instructionMessage != null) + message.instructionMessage = String(object.instructionMessage); + return message; + }; + + /** + * Creates a plain object from a BoundingPolyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.BoundingPolyConfig} message BoundingPolyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingPolyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecSet = ""; + object.instructionMessage = ""; + } + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + if (message.instructionMessage != null && message.hasOwnProperty("instructionMessage")) + object.instructionMessage = message.instructionMessage; + return object; + }; + + /** + * Converts this BoundingPolyConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @instance + * @returns {Object.} JSON object + */ + BoundingPolyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingPolyConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.BoundingPolyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingPolyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.BoundingPolyConfig"; + }; + + return BoundingPolyConfig; + })(); + + v1beta1.PolylineConfig = (function() { + + /** + * Properties of a PolylineConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IPolylineConfig + * @property {string|null} [annotationSpecSet] PolylineConfig annotationSpecSet + * @property {string|null} [instructionMessage] PolylineConfig instructionMessage + */ + + /** + * Constructs a new PolylineConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a PolylineConfig. + * @implements IPolylineConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IPolylineConfig=} [properties] Properties to set + */ + function PolylineConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolylineConfig annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @instance + */ + PolylineConfig.prototype.annotationSpecSet = ""; + + /** + * PolylineConfig instructionMessage. + * @member {string} instructionMessage + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @instance + */ + PolylineConfig.prototype.instructionMessage = ""; + + /** + * Creates a new PolylineConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IPolylineConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.PolylineConfig} PolylineConfig instance + */ + PolylineConfig.create = function create(properties) { + return new PolylineConfig(properties); + }; + + /** + * Encodes the specified PolylineConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PolylineConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IPolylineConfig} message PolylineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolylineConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecSet); + if (message.instructionMessage != null && Object.hasOwnProperty.call(message, "instructionMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instructionMessage); + return writer; + }; + + /** + * Encodes the specified PolylineConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PolylineConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IPolylineConfig} message PolylineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolylineConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolylineConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.PolylineConfig} PolylineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolylineConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.PolylineConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpecSet = reader.string(); + break; + } + case 2: { + message.instructionMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolylineConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.PolylineConfig} PolylineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolylineConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolylineConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolylineConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: string expected"; + if (message.instructionMessage != null && message.hasOwnProperty("instructionMessage")) + if (!$util.isString(message.instructionMessage)) + return "instructionMessage: string expected"; + return null; + }; + + /** + * Creates a PolylineConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.PolylineConfig} PolylineConfig + */ + PolylineConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.PolylineConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.PolylineConfig(); + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + if (object.instructionMessage != null) + message.instructionMessage = String(object.instructionMessage); + return message; + }; + + /** + * Creates a plain object from a PolylineConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.PolylineConfig} message PolylineConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolylineConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecSet = ""; + object.instructionMessage = ""; + } + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + if (message.instructionMessage != null && message.hasOwnProperty("instructionMessage")) + object.instructionMessage = message.instructionMessage; + return object; + }; + + /** + * Converts this PolylineConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @instance + * @returns {Object.} JSON object + */ + PolylineConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolylineConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.PolylineConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolylineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.PolylineConfig"; + }; + + return PolylineConfig; + })(); + + v1beta1.SegmentationConfig = (function() { + + /** + * Properties of a SegmentationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ISegmentationConfig + * @property {string|null} [annotationSpecSet] SegmentationConfig annotationSpecSet + * @property {string|null} [instructionMessage] SegmentationConfig instructionMessage + */ + + /** + * Constructs a new SegmentationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a SegmentationConfig. + * @implements ISegmentationConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ISegmentationConfig=} [properties] Properties to set + */ + function SegmentationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SegmentationConfig annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @instance + */ + SegmentationConfig.prototype.annotationSpecSet = ""; + + /** + * SegmentationConfig instructionMessage. + * @member {string} instructionMessage + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @instance + */ + SegmentationConfig.prototype.instructionMessage = ""; + + /** + * Creates a new SegmentationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ISegmentationConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.SegmentationConfig} SegmentationConfig instance + */ + SegmentationConfig.create = function create(properties) { + return new SegmentationConfig(properties); + }; + + /** + * Encodes the specified SegmentationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SegmentationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ISegmentationConfig} message SegmentationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecSet); + if (message.instructionMessage != null && Object.hasOwnProperty.call(message, "instructionMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instructionMessage); + return writer; + }; + + /** + * Encodes the specified SegmentationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SegmentationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ISegmentationConfig} message SegmentationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.SegmentationConfig} SegmentationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.SegmentationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpecSet = reader.string(); + break; + } + case 2: { + message.instructionMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.SegmentationConfig} SegmentationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentationConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: string expected"; + if (message.instructionMessage != null && message.hasOwnProperty("instructionMessage")) + if (!$util.isString(message.instructionMessage)) + return "instructionMessage: string expected"; + return null; + }; + + /** + * Creates a SegmentationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.SegmentationConfig} SegmentationConfig + */ + SegmentationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.SegmentationConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.SegmentationConfig(); + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + if (object.instructionMessage != null) + message.instructionMessage = String(object.instructionMessage); + return message; + }; + + /** + * Creates a plain object from a SegmentationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.SegmentationConfig} message SegmentationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecSet = ""; + object.instructionMessage = ""; + } + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + if (message.instructionMessage != null && message.hasOwnProperty("instructionMessage")) + object.instructionMessage = message.instructionMessage; + return object; + }; + + /** + * Converts this SegmentationConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @instance + * @returns {Object.} JSON object + */ + SegmentationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentationConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.SegmentationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.SegmentationConfig"; + }; + + return SegmentationConfig; + })(); + + v1beta1.VideoClassificationConfig = (function() { + + /** + * Properties of a VideoClassificationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IVideoClassificationConfig + * @property {Array.|null} [annotationSpecSetConfigs] VideoClassificationConfig annotationSpecSetConfigs + * @property {boolean|null} [applyShotDetection] VideoClassificationConfig applyShotDetection + */ + + /** + * Constructs a new VideoClassificationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a VideoClassificationConfig. + * @implements IVideoClassificationConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IVideoClassificationConfig=} [properties] Properties to set + */ + function VideoClassificationConfig(properties) { + this.annotationSpecSetConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoClassificationConfig annotationSpecSetConfigs. + * @member {Array.} annotationSpecSetConfigs + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @instance + */ + VideoClassificationConfig.prototype.annotationSpecSetConfigs = $util.emptyArray; + + /** + * VideoClassificationConfig applyShotDetection. + * @member {boolean} applyShotDetection + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @instance + */ + VideoClassificationConfig.prototype.applyShotDetection = false; + + /** + * Creates a new VideoClassificationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoClassificationConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationConfig} VideoClassificationConfig instance + */ + VideoClassificationConfig.create = function create(properties) { + return new VideoClassificationConfig(properties); + }; + + /** + * Encodes the specified VideoClassificationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoClassificationConfig} message VideoClassificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSetConfigs != null && message.annotationSpecSetConfigs.length) + for (var i = 0; i < message.annotationSpecSetConfigs.length; ++i) + $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.encode(message.annotationSpecSetConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.applyShotDetection != null && Object.hasOwnProperty.call(message, "applyShotDetection")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.applyShotDetection); + return writer; + }; + + /** + * Encodes the specified VideoClassificationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IVideoClassificationConfig} message VideoClassificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoClassificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationConfig} VideoClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationSpecSetConfigs && message.annotationSpecSetConfigs.length)) + message.annotationSpecSetConfigs = []; + message.annotationSpecSetConfigs.push($root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.applyShotDetection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoClassificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationConfig} VideoClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoClassificationConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoClassificationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSetConfigs != null && message.hasOwnProperty("annotationSpecSetConfigs")) { + if (!Array.isArray(message.annotationSpecSetConfigs)) + return "annotationSpecSetConfigs: array expected"; + for (var i = 0; i < message.annotationSpecSetConfigs.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.verify(message.annotationSpecSetConfigs[i]); + if (error) + return "annotationSpecSetConfigs." + error; + } + } + if (message.applyShotDetection != null && message.hasOwnProperty("applyShotDetection")) + if (typeof message.applyShotDetection !== "boolean") + return "applyShotDetection: boolean expected"; + return null; + }; + + /** + * Creates a VideoClassificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationConfig} VideoClassificationConfig + */ + VideoClassificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig(); + if (object.annotationSpecSetConfigs) { + if (!Array.isArray(object.annotationSpecSetConfigs)) + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoClassificationConfig.annotationSpecSetConfigs: array expected"); + message.annotationSpecSetConfigs = []; + for (var i = 0; i < object.annotationSpecSetConfigs.length; ++i) { + if (typeof object.annotationSpecSetConfigs[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.VideoClassificationConfig.annotationSpecSetConfigs: object expected"); + message.annotationSpecSetConfigs[i] = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.fromObject(object.annotationSpecSetConfigs[i]); + } + } + if (object.applyShotDetection != null) + message.applyShotDetection = Boolean(object.applyShotDetection); + return message; + }; + + /** + * Creates a plain object from a VideoClassificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoClassificationConfig} message VideoClassificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoClassificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationSpecSetConfigs = []; + if (options.defaults) + object.applyShotDetection = false; + if (message.annotationSpecSetConfigs && message.annotationSpecSetConfigs.length) { + object.annotationSpecSetConfigs = []; + for (var j = 0; j < message.annotationSpecSetConfigs.length; ++j) + object.annotationSpecSetConfigs[j] = $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.toObject(message.annotationSpecSetConfigs[j], options); + } + if (message.applyShotDetection != null && message.hasOwnProperty("applyShotDetection")) + object.applyShotDetection = message.applyShotDetection; + return object; + }; + + /** + * Converts this VideoClassificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @instance + * @returns {Object.} JSON object + */ + VideoClassificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoClassificationConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoClassificationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.VideoClassificationConfig"; + }; + + VideoClassificationConfig.AnnotationSpecSetConfig = (function() { + + /** + * Properties of an AnnotationSpecSetConfig. + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @interface IAnnotationSpecSetConfig + * @property {string|null} [annotationSpecSet] AnnotationSpecSetConfig annotationSpecSet + * @property {boolean|null} [allowMultiLabel] AnnotationSpecSetConfig allowMultiLabel + */ + + /** + * Constructs a new AnnotationSpecSetConfig. + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig + * @classdesc Represents an AnnotationSpecSetConfig. + * @implements IAnnotationSpecSetConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig=} [properties] Properties to set + */ + function AnnotationSpecSetConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationSpecSetConfig annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @instance + */ + AnnotationSpecSetConfig.prototype.annotationSpecSet = ""; + + /** + * AnnotationSpecSetConfig allowMultiLabel. + * @member {boolean} allowMultiLabel + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @instance + */ + AnnotationSpecSetConfig.prototype.allowMultiLabel = false; + + /** + * Creates a new AnnotationSpecSetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig} AnnotationSpecSetConfig instance + */ + AnnotationSpecSetConfig.create = function create(properties) { + return new AnnotationSpecSetConfig(properties); + }; + + /** + * Encodes the specified AnnotationSpecSetConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig} message AnnotationSpecSetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpecSetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecSet); + if (message.allowMultiLabel != null && Object.hasOwnProperty.call(message, "allowMultiLabel")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowMultiLabel); + return writer; + }; + + /** + * Encodes the specified AnnotationSpecSetConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoClassificationConfig.IAnnotationSpecSetConfig} message AnnotationSpecSetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpecSetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationSpecSetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig} AnnotationSpecSetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpecSetConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpecSet = reader.string(); + break; + } + case 2: { + message.allowMultiLabel = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationSpecSetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig} AnnotationSpecSetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpecSetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationSpecSetConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationSpecSetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: string expected"; + if (message.allowMultiLabel != null && message.hasOwnProperty("allowMultiLabel")) + if (typeof message.allowMultiLabel !== "boolean") + return "allowMultiLabel: boolean expected"; + return null; + }; + + /** + * Creates an AnnotationSpecSetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig} AnnotationSpecSetConfig + */ + AnnotationSpecSetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig(); + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + if (object.allowMultiLabel != null) + message.allowMultiLabel = Boolean(object.allowMultiLabel); + return message; + }; + + /** + * Creates a plain object from an AnnotationSpecSetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig} message AnnotationSpecSetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationSpecSetConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecSet = ""; + object.allowMultiLabel = false; + } + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + if (message.allowMultiLabel != null && message.hasOwnProperty("allowMultiLabel")) + object.allowMultiLabel = message.allowMultiLabel; + return object; + }; + + /** + * Converts this AnnotationSpecSetConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @instance + * @returns {Object.} JSON object + */ + AnnotationSpecSetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationSpecSetConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationSpecSetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig"; + }; + + return AnnotationSpecSetConfig; + })(); + + return VideoClassificationConfig; + })(); + + v1beta1.ObjectDetectionConfig = (function() { + + /** + * Properties of an ObjectDetectionConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IObjectDetectionConfig + * @property {string|null} [annotationSpecSet] ObjectDetectionConfig annotationSpecSet + * @property {number|null} [extractionFrameRate] ObjectDetectionConfig extractionFrameRate + */ + + /** + * Constructs a new ObjectDetectionConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ObjectDetectionConfig. + * @implements IObjectDetectionConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IObjectDetectionConfig=} [properties] Properties to set + */ + function ObjectDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectDetectionConfig annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @instance + */ + ObjectDetectionConfig.prototype.annotationSpecSet = ""; + + /** + * ObjectDetectionConfig extractionFrameRate. + * @member {number} extractionFrameRate + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @instance + */ + ObjectDetectionConfig.prototype.extractionFrameRate = 0; + + /** + * Creates a new ObjectDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IObjectDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ObjectDetectionConfig} ObjectDetectionConfig instance + */ + ObjectDetectionConfig.create = function create(properties) { + return new ObjectDetectionConfig(properties); + }; + + /** + * Encodes the specified ObjectDetectionConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IObjectDetectionConfig} message ObjectDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecSet); + if (message.extractionFrameRate != null && Object.hasOwnProperty.call(message, "extractionFrameRate")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.extractionFrameRate); + return writer; + }; + + /** + * Encodes the specified ObjectDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IObjectDetectionConfig} message ObjectDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ObjectDetectionConfig} ObjectDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectDetectionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpecSet = reader.string(); + break; + } + case 3: { + message.extractionFrameRate = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ObjectDetectionConfig} ObjectDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectDetectionConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: string expected"; + if (message.extractionFrameRate != null && message.hasOwnProperty("extractionFrameRate")) + if (typeof message.extractionFrameRate !== "number") + return "extractionFrameRate: number expected"; + return null; + }; + + /** + * Creates an ObjectDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ObjectDetectionConfig} ObjectDetectionConfig + */ + ObjectDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ObjectDetectionConfig(); + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + if (object.extractionFrameRate != null) + message.extractionFrameRate = Number(object.extractionFrameRate); + return message; + }; + + /** + * Creates a plain object from an ObjectDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ObjectDetectionConfig} message ObjectDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecSet = ""; + object.extractionFrameRate = 0; + } + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + if (message.extractionFrameRate != null && message.hasOwnProperty("extractionFrameRate")) + object.extractionFrameRate = options.json && !isFinite(message.extractionFrameRate) ? String(message.extractionFrameRate) : message.extractionFrameRate; + return object; + }; + + /** + * Converts this ObjectDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ObjectDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ObjectDetectionConfig"; + }; + + return ObjectDetectionConfig; + })(); + + v1beta1.ObjectTrackingConfig = (function() { + + /** + * Properties of an ObjectTrackingConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IObjectTrackingConfig + * @property {string|null} [annotationSpecSet] ObjectTrackingConfig annotationSpecSet + */ + + /** + * Constructs a new ObjectTrackingConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ObjectTrackingConfig. + * @implements IObjectTrackingConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.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 annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingConfig + * @instance + */ + ObjectTrackingConfig.prototype.annotationSpecSet = ""; + + /** + * Creates a new ObjectTrackingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IObjectTrackingConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ObjectTrackingConfig} ObjectTrackingConfig instance + */ + ObjectTrackingConfig.create = function create(properties) { + return new ObjectTrackingConfig(properties); + }; + + /** + * Encodes the specified ObjectTrackingConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.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.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecSet); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.ObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.ObjectTrackingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpecSet = 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.datalabeling.v1beta1.ObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: 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.datalabeling.v1beta1.ObjectTrackingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ObjectTrackingConfig} ObjectTrackingConfig + */ + ObjectTrackingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ObjectTrackingConfig(); + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + return message; + }; + + /** + * Creates a plain object from an ObjectTrackingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ObjectTrackingConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.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.annotationSpecSet = ""; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + return object; + }; + + /** + * Converts this ObjectTrackingConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.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.datalabeling.v1beta1.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.datalabeling.v1beta1.ObjectTrackingConfig"; + }; + + return ObjectTrackingConfig; + })(); + + v1beta1.EventConfig = (function() { + + /** + * Properties of an EventConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IEventConfig + * @property {Array.|null} [annotationSpecSets] EventConfig annotationSpecSets + */ + + /** + * Constructs a new EventConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an EventConfig. + * @implements IEventConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IEventConfig=} [properties] Properties to set + */ + function EventConfig(properties) { + this.annotationSpecSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventConfig annotationSpecSets. + * @member {Array.} annotationSpecSets + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @instance + */ + EventConfig.prototype.annotationSpecSets = $util.emptyArray; + + /** + * Creates a new EventConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEventConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.EventConfig} EventConfig instance + */ + EventConfig.create = function create(properties) { + return new EventConfig(properties); + }; + + /** + * Encodes the specified EventConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EventConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEventConfig} message EventConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSets != null && message.annotationSpecSets.length) + for (var i = 0; i < message.annotationSpecSets.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecSets[i]); + return writer; + }; + + /** + * Encodes the specified EventConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EventConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEventConfig} message EventConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.EventConfig} EventConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.EventConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationSpecSets && message.annotationSpecSets.length)) + message.annotationSpecSets = []; + message.annotationSpecSets.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.EventConfig} EventConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSets != null && message.hasOwnProperty("annotationSpecSets")) { + if (!Array.isArray(message.annotationSpecSets)) + return "annotationSpecSets: array expected"; + for (var i = 0; i < message.annotationSpecSets.length; ++i) + if (!$util.isString(message.annotationSpecSets[i])) + return "annotationSpecSets: string[] expected"; + } + return null; + }; + + /** + * Creates an EventConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.EventConfig} EventConfig + */ + EventConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.EventConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.EventConfig(); + if (object.annotationSpecSets) { + if (!Array.isArray(object.annotationSpecSets)) + throw TypeError(".google.cloud.datalabeling.v1beta1.EventConfig.annotationSpecSets: array expected"); + message.annotationSpecSets = []; + for (var i = 0; i < object.annotationSpecSets.length; ++i) + message.annotationSpecSets[i] = String(object.annotationSpecSets[i]); + } + return message; + }; + + /** + * Creates a plain object from an EventConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.EventConfig} message EventConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationSpecSets = []; + if (message.annotationSpecSets && message.annotationSpecSets.length) { + object.annotationSpecSets = []; + for (var j = 0; j < message.annotationSpecSets.length; ++j) + object.annotationSpecSets[j] = message.annotationSpecSets[j]; + } + return object; + }; + + /** + * Converts this EventConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @instance + * @returns {Object.} JSON object + */ + EventConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.EventConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.EventConfig"; + }; + + return EventConfig; + })(); + + v1beta1.TextClassificationConfig = (function() { + + /** + * Properties of a TextClassificationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ITextClassificationConfig + * @property {boolean|null} [allowMultiLabel] TextClassificationConfig allowMultiLabel + * @property {string|null} [annotationSpecSet] TextClassificationConfig annotationSpecSet + * @property {google.cloud.datalabeling.v1beta1.ISentimentConfig|null} [sentimentConfig] TextClassificationConfig sentimentConfig + */ + + /** + * Constructs a new TextClassificationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a TextClassificationConfig. + * @implements ITextClassificationConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ITextClassificationConfig=} [properties] Properties to set + */ + function TextClassificationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationConfig allowMultiLabel. + * @member {boolean} allowMultiLabel + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @instance + */ + TextClassificationConfig.prototype.allowMultiLabel = false; + + /** + * TextClassificationConfig annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @instance + */ + TextClassificationConfig.prototype.annotationSpecSet = ""; + + /** + * TextClassificationConfig sentimentConfig. + * @member {google.cloud.datalabeling.v1beta1.ISentimentConfig|null|undefined} sentimentConfig + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @instance + */ + TextClassificationConfig.prototype.sentimentConfig = null; + + /** + * Creates a new TextClassificationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextClassificationConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.TextClassificationConfig} TextClassificationConfig instance + */ + TextClassificationConfig.create = function create(properties) { + return new TextClassificationConfig(properties); + }; + + /** + * Encodes the specified TextClassificationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextClassificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextClassificationConfig} message TextClassificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowMultiLabel != null && Object.hasOwnProperty.call(message, "allowMultiLabel")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowMultiLabel); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.annotationSpecSet); + if (message.sentimentConfig != null && Object.hasOwnProperty.call(message, "sentimentConfig")) + $root.google.cloud.datalabeling.v1beta1.SentimentConfig.encode(message.sentimentConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextClassificationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextClassificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextClassificationConfig} message TextClassificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.TextClassificationConfig} TextClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.allowMultiLabel = reader.bool(); + break; + } + case 2: { + message.annotationSpecSet = reader.string(); + break; + } + case 3: { + message.sentimentConfig = $root.google.cloud.datalabeling.v1beta1.SentimentConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.TextClassificationConfig} TextClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowMultiLabel != null && message.hasOwnProperty("allowMultiLabel")) + if (typeof message.allowMultiLabel !== "boolean") + return "allowMultiLabel: boolean expected"; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: string expected"; + if (message.sentimentConfig != null && message.hasOwnProperty("sentimentConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.SentimentConfig.verify(message.sentimentConfig); + if (error) + return "sentimentConfig." + error; + } + return null; + }; + + /** + * Creates a TextClassificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.TextClassificationConfig} TextClassificationConfig + */ + TextClassificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig(); + if (object.allowMultiLabel != null) + message.allowMultiLabel = Boolean(object.allowMultiLabel); + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + if (object.sentimentConfig != null) { + if (typeof object.sentimentConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.TextClassificationConfig.sentimentConfig: object expected"); + message.sentimentConfig = $root.google.cloud.datalabeling.v1beta1.SentimentConfig.fromObject(object.sentimentConfig); + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.TextClassificationConfig} message TextClassificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.allowMultiLabel = false; + object.annotationSpecSet = ""; + object.sentimentConfig = null; + } + if (message.allowMultiLabel != null && message.hasOwnProperty("allowMultiLabel")) + object.allowMultiLabel = message.allowMultiLabel; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + if (message.sentimentConfig != null && message.hasOwnProperty("sentimentConfig")) + object.sentimentConfig = $root.google.cloud.datalabeling.v1beta1.SentimentConfig.toObject(message.sentimentConfig, options); + return object; + }; + + /** + * Converts this TextClassificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @instance + * @returns {Object.} JSON object + */ + TextClassificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.TextClassificationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.TextClassificationConfig"; + }; + + return TextClassificationConfig; + })(); + + v1beta1.SentimentConfig = (function() { + + /** + * Properties of a SentimentConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ISentimentConfig + * @property {boolean|null} [enableLabelSentimentSelection] SentimentConfig enableLabelSentimentSelection + */ + + /** + * Constructs a new SentimentConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a SentimentConfig. + * @implements ISentimentConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ISentimentConfig=} [properties] Properties to set + */ + function SentimentConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SentimentConfig enableLabelSentimentSelection. + * @member {boolean} enableLabelSentimentSelection + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @instance + */ + SentimentConfig.prototype.enableLabelSentimentSelection = false; + + /** + * Creates a new SentimentConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ISentimentConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.SentimentConfig} SentimentConfig instance + */ + SentimentConfig.create = function create(properties) { + return new SentimentConfig(properties); + }; + + /** + * Encodes the specified SentimentConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SentimentConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ISentimentConfig} message SentimentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableLabelSentimentSelection != null && Object.hasOwnProperty.call(message, "enableLabelSentimentSelection")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableLabelSentimentSelection); + return writer; + }; + + /** + * Encodes the specified SentimentConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.SentimentConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ISentimentConfig} message SentimentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SentimentConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.SentimentConfig} SentimentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.SentimentConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableLabelSentimentSelection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SentimentConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.SentimentConfig} SentimentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SentimentConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SentimentConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableLabelSentimentSelection != null && message.hasOwnProperty("enableLabelSentimentSelection")) + if (typeof message.enableLabelSentimentSelection !== "boolean") + return "enableLabelSentimentSelection: boolean expected"; + return null; + }; + + /** + * Creates a SentimentConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.SentimentConfig} SentimentConfig + */ + SentimentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.SentimentConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.SentimentConfig(); + if (object.enableLabelSentimentSelection != null) + message.enableLabelSentimentSelection = Boolean(object.enableLabelSentimentSelection); + return message; + }; + + /** + * Creates a plain object from a SentimentConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.SentimentConfig} message SentimentConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SentimentConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableLabelSentimentSelection = false; + if (message.enableLabelSentimentSelection != null && message.hasOwnProperty("enableLabelSentimentSelection")) + object.enableLabelSentimentSelection = message.enableLabelSentimentSelection; + return object; + }; + + /** + * Converts this SentimentConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @instance + * @returns {Object.} JSON object + */ + SentimentConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SentimentConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.SentimentConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SentimentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.SentimentConfig"; + }; + + return SentimentConfig; + })(); + + v1beta1.TextEntityExtractionConfig = (function() { + + /** + * Properties of a TextEntityExtractionConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ITextEntityExtractionConfig + * @property {string|null} [annotationSpecSet] TextEntityExtractionConfig annotationSpecSet + */ + + /** + * Constructs a new TextEntityExtractionConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a TextEntityExtractionConfig. + * @implements ITextEntityExtractionConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig=} [properties] Properties to set + */ + function TextEntityExtractionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextEntityExtractionConfig annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @instance + */ + TextEntityExtractionConfig.prototype.annotationSpecSet = ""; + + /** + * Creates a new TextEntityExtractionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig} TextEntityExtractionConfig instance + */ + TextEntityExtractionConfig.create = function create(properties) { + return new TextEntityExtractionConfig(properties); + }; + + /** + * Encodes the specified TextEntityExtractionConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig} message TextEntityExtractionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextEntityExtractionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecSet); + return writer; + }; + + /** + * Encodes the specified TextEntityExtractionConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.ITextEntityExtractionConfig} message TextEntityExtractionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextEntityExtractionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextEntityExtractionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig} TextEntityExtractionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextEntityExtractionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpecSet = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextEntityExtractionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig} TextEntityExtractionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextEntityExtractionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextEntityExtractionConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextEntityExtractionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: string expected"; + return null; + }; + + /** + * Creates a TextEntityExtractionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig} TextEntityExtractionConfig + */ + TextEntityExtractionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig(); + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + return message; + }; + + /** + * Creates a plain object from a TextEntityExtractionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig} message TextEntityExtractionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextEntityExtractionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.annotationSpecSet = ""; + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + return object; + }; + + /** + * Converts this TextEntityExtractionConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @instance + * @returns {Object.} JSON object + */ + TextEntityExtractionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextEntityExtractionConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextEntityExtractionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig"; + }; + + return TextEntityExtractionConfig; + })(); + + v1beta1.Evaluation = (function() { + + /** + * Properties of an Evaluation. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IEvaluation + * @property {string|null} [name] Evaluation name + * @property {google.cloud.datalabeling.v1beta1.IEvaluationConfig|null} [config] Evaluation config + * @property {google.protobuf.ITimestamp|null} [evaluationJobRunTime] Evaluation evaluationJobRunTime + * @property {google.protobuf.ITimestamp|null} [createTime] Evaluation createTime + * @property {google.cloud.datalabeling.v1beta1.IEvaluationMetrics|null} [evaluationMetrics] Evaluation evaluationMetrics + * @property {google.cloud.datalabeling.v1beta1.AnnotationType|null} [annotationType] Evaluation annotationType + * @property {number|Long|null} [evaluatedItemCount] Evaluation evaluatedItemCount + */ + + /** + * Constructs a new Evaluation. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an Evaluation. + * @implements IEvaluation + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IEvaluation=} [properties] Properties to set + */ + function Evaluation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evaluation name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @instance + */ + Evaluation.prototype.name = ""; + + /** + * Evaluation config. + * @member {google.cloud.datalabeling.v1beta1.IEvaluationConfig|null|undefined} config + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @instance + */ + Evaluation.prototype.config = null; + + /** + * Evaluation evaluationJobRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} evaluationJobRunTime + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @instance + */ + Evaluation.prototype.evaluationJobRunTime = null; + + /** + * Evaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @instance + */ + Evaluation.prototype.createTime = null; + + /** + * Evaluation evaluationMetrics. + * @member {google.cloud.datalabeling.v1beta1.IEvaluationMetrics|null|undefined} evaluationMetrics + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @instance + */ + Evaluation.prototype.evaluationMetrics = null; + + /** + * Evaluation annotationType. + * @member {google.cloud.datalabeling.v1beta1.AnnotationType} annotationType + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @instance + */ + Evaluation.prototype.annotationType = 0; + + /** + * Evaluation evaluatedItemCount. + * @member {number|Long} evaluatedItemCount + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @instance + */ + Evaluation.prototype.evaluatedItemCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Evaluation instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluation=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.Evaluation} Evaluation instance + */ + Evaluation.create = function create(properties) { + return new Evaluation(properties); + }; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Evaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.evaluationJobRunTime != null && Object.hasOwnProperty.call(message, "evaluationJobRunTime")) + $root.google.protobuf.Timestamp.encode(message.evaluationJobRunTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.evaluationMetrics != null && Object.hasOwnProperty.call(message, "evaluationMetrics")) + $root.google.cloud.datalabeling.v1beta1.EvaluationMetrics.encode(message.evaluationMetrics, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.annotationType != null && Object.hasOwnProperty.call(message, "annotationType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.annotationType); + if (message.evaluatedItemCount != null && Object.hasOwnProperty.call(message, "evaluatedItemCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.evaluatedItemCount); + return writer; + }; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Evaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.Evaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.config = $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.evaluationJobRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.evaluationMetrics = $root.google.cloud.datalabeling.v1beta1.EvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 6: { + message.annotationType = reader.int32(); + break; + } + case 7: { + message.evaluatedItemCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evaluation message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.evaluationJobRunTime != null && message.hasOwnProperty("evaluationJobRunTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.evaluationJobRunTime); + if (error) + return "evaluationJobRunTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.evaluationMetrics != null && message.hasOwnProperty("evaluationMetrics")) { + var error = $root.google.cloud.datalabeling.v1beta1.EvaluationMetrics.verify(message.evaluationMetrics); + if (error) + return "evaluationMetrics." + error; + } + if (message.annotationType != null && message.hasOwnProperty("annotationType")) + switch (message.annotationType) { + default: + return "annotationType: enum value expected"; + case 0: + case 1: + case 2: + case 13: + case 10: + case 11: + case 12: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + case 14: + break; + } + if (message.evaluatedItemCount != null && message.hasOwnProperty("evaluatedItemCount")) + if (!$util.isInteger(message.evaluatedItemCount) && !(message.evaluatedItemCount && $util.isInteger(message.evaluatedItemCount.low) && $util.isInteger(message.evaluatedItemCount.high))) + return "evaluatedItemCount: integer|Long expected"; + return null; + }; + + /** + * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.Evaluation} Evaluation + */ + Evaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.Evaluation) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.Evaluation(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Evaluation.config: object expected"); + message.config = $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.fromObject(object.config); + } + if (object.evaluationJobRunTime != null) { + if (typeof object.evaluationJobRunTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Evaluation.evaluationJobRunTime: object expected"); + message.evaluationJobRunTime = $root.google.protobuf.Timestamp.fromObject(object.evaluationJobRunTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Evaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.evaluationMetrics != null) { + if (typeof object.evaluationMetrics !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Evaluation.evaluationMetrics: object expected"); + message.evaluationMetrics = $root.google.cloud.datalabeling.v1beta1.EvaluationMetrics.fromObject(object.evaluationMetrics); + } + switch (object.annotationType) { + default: + if (typeof object.annotationType === "number") { + message.annotationType = object.annotationType; + break; + } + break; + case "ANNOTATION_TYPE_UNSPECIFIED": + case 0: + message.annotationType = 0; + break; + case "IMAGE_CLASSIFICATION_ANNOTATION": + case 1: + message.annotationType = 1; + break; + case "IMAGE_BOUNDING_BOX_ANNOTATION": + case 2: + message.annotationType = 2; + break; + case "IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION": + case 13: + message.annotationType = 13; + break; + case "IMAGE_BOUNDING_POLY_ANNOTATION": + case 10: + message.annotationType = 10; + break; + case "IMAGE_POLYLINE_ANNOTATION": + case 11: + message.annotationType = 11; + break; + case "IMAGE_SEGMENTATION_ANNOTATION": + case 12: + message.annotationType = 12; + break; + case "VIDEO_SHOTS_CLASSIFICATION_ANNOTATION": + case 3: + message.annotationType = 3; + break; + case "VIDEO_OBJECT_TRACKING_ANNOTATION": + case 4: + message.annotationType = 4; + break; + case "VIDEO_OBJECT_DETECTION_ANNOTATION": + case 5: + message.annotationType = 5; + break; + case "VIDEO_EVENT_ANNOTATION": + case 6: + message.annotationType = 6; + break; + case "TEXT_CLASSIFICATION_ANNOTATION": + case 8: + message.annotationType = 8; + break; + case "TEXT_ENTITY_EXTRACTION_ANNOTATION": + case 9: + message.annotationType = 9; + break; + case "GENERAL_CLASSIFICATION_ANNOTATION": + case 14: + message.annotationType = 14; + break; + } + if (object.evaluatedItemCount != null) + if ($util.Long) + (message.evaluatedItemCount = $util.Long.fromValue(object.evaluatedItemCount)).unsigned = false; + else if (typeof object.evaluatedItemCount === "string") + message.evaluatedItemCount = parseInt(object.evaluatedItemCount, 10); + else if (typeof object.evaluatedItemCount === "number") + message.evaluatedItemCount = object.evaluatedItemCount; + else if (typeof object.evaluatedItemCount === "object") + message.evaluatedItemCount = new $util.LongBits(object.evaluatedItemCount.low >>> 0, object.evaluatedItemCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @static + * @param {google.cloud.datalabeling.v1beta1.Evaluation} message Evaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.config = null; + object.evaluationJobRunTime = null; + object.createTime = null; + object.evaluationMetrics = null; + object.annotationType = options.enums === String ? "ANNOTATION_TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.evaluatedItemCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.evaluatedItemCount = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.toObject(message.config, options); + if (message.evaluationJobRunTime != null && message.hasOwnProperty("evaluationJobRunTime")) + object.evaluationJobRunTime = $root.google.protobuf.Timestamp.toObject(message.evaluationJobRunTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.evaluationMetrics != null && message.hasOwnProperty("evaluationMetrics")) + object.evaluationMetrics = $root.google.cloud.datalabeling.v1beta1.EvaluationMetrics.toObject(message.evaluationMetrics, options); + if (message.annotationType != null && message.hasOwnProperty("annotationType")) + object.annotationType = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.AnnotationType[message.annotationType] === undefined ? message.annotationType : $root.google.cloud.datalabeling.v1beta1.AnnotationType[message.annotationType] : message.annotationType; + if (message.evaluatedItemCount != null && message.hasOwnProperty("evaluatedItemCount")) + if (typeof message.evaluatedItemCount === "number") + object.evaluatedItemCount = options.longs === String ? String(message.evaluatedItemCount) : message.evaluatedItemCount; + else + object.evaluatedItemCount = options.longs === String ? $util.Long.prototype.toString.call(message.evaluatedItemCount) : options.longs === Number ? new $util.LongBits(message.evaluatedItemCount.low >>> 0, message.evaluatedItemCount.high >>> 0).toNumber() : message.evaluatedItemCount; + return object; + }; + + /** + * Converts this Evaluation to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @instance + * @returns {Object.} JSON object + */ + Evaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Evaluation + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.Evaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Evaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.Evaluation"; + }; + + return Evaluation; + })(); + + v1beta1.EvaluationConfig = (function() { + + /** + * Properties of an EvaluationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IEvaluationConfig + * @property {google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions|null} [boundingBoxEvaluationOptions] EvaluationConfig boundingBoxEvaluationOptions + */ + + /** + * Constructs a new EvaluationConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an EvaluationConfig. + * @implements IEvaluationConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IEvaluationConfig=} [properties] Properties to set + */ + function EvaluationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationConfig boundingBoxEvaluationOptions. + * @member {google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions|null|undefined} boundingBoxEvaluationOptions + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @instance + */ + EvaluationConfig.prototype.boundingBoxEvaluationOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EvaluationConfig verticalOption. + * @member {"boundingBoxEvaluationOptions"|undefined} verticalOption + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @instance + */ + Object.defineProperty(EvaluationConfig.prototype, "verticalOption", { + get: $util.oneOfGetter($oneOfFields = ["boundingBoxEvaluationOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EvaluationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.EvaluationConfig} EvaluationConfig instance + */ + EvaluationConfig.create = function create(properties) { + return new EvaluationConfig(properties); + }; + + /** + * Encodes the specified EvaluationConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationConfig} message EvaluationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingBoxEvaluationOptions != null && Object.hasOwnProperty.call(message, "boundingBoxEvaluationOptions")) + $root.google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.encode(message.boundingBoxEvaluationOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationConfig} message EvaluationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.EvaluationConfig} EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.EvaluationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.boundingBoxEvaluationOptions = $root.google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.EvaluationConfig} EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.boundingBoxEvaluationOptions != null && message.hasOwnProperty("boundingBoxEvaluationOptions")) { + properties.verticalOption = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.verify(message.boundingBoxEvaluationOptions); + if (error) + return "boundingBoxEvaluationOptions." + error; + } + } + return null; + }; + + /** + * Creates an EvaluationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.EvaluationConfig} EvaluationConfig + */ + EvaluationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.EvaluationConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.EvaluationConfig(); + if (object.boundingBoxEvaluationOptions != null) { + if (typeof object.boundingBoxEvaluationOptions !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationConfig.boundingBoxEvaluationOptions: object expected"); + message.boundingBoxEvaluationOptions = $root.google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.fromObject(object.boundingBoxEvaluationOptions); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.EvaluationConfig} message EvaluationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.boundingBoxEvaluationOptions != null && message.hasOwnProperty("boundingBoxEvaluationOptions")) { + object.boundingBoxEvaluationOptions = $root.google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.toObject(message.boundingBoxEvaluationOptions, options); + if (options.oneofs) + object.verticalOption = "boundingBoxEvaluationOptions"; + } + return object; + }; + + /** + * Converts this EvaluationConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @instance + * @returns {Object.} JSON object + */ + EvaluationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.EvaluationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.EvaluationConfig"; + }; + + return EvaluationConfig; + })(); + + v1beta1.BoundingBoxEvaluationOptions = (function() { + + /** + * Properties of a BoundingBoxEvaluationOptions. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IBoundingBoxEvaluationOptions + * @property {number|null} [iouThreshold] BoundingBoxEvaluationOptions iouThreshold + */ + + /** + * Constructs a new BoundingBoxEvaluationOptions. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a BoundingBoxEvaluationOptions. + * @implements IBoundingBoxEvaluationOptions + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions=} [properties] Properties to set + */ + function BoundingBoxEvaluationOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingBoxEvaluationOptions iouThreshold. + * @member {number} iouThreshold + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @instance + */ + BoundingBoxEvaluationOptions.prototype.iouThreshold = 0; + + /** + * Creates a new BoundingBoxEvaluationOptions instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @static + * @param {google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions} BoundingBoxEvaluationOptions instance + */ + BoundingBoxEvaluationOptions.create = function create(properties) { + return new BoundingBoxEvaluationOptions(properties); + }; + + /** + * Encodes the specified BoundingBoxEvaluationOptions message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @static + * @param {google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions} message BoundingBoxEvaluationOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxEvaluationOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iouThreshold != null && Object.hasOwnProperty.call(message, "iouThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.iouThreshold); + return writer; + }; + + /** + * Encodes the specified BoundingBoxEvaluationOptions message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @static + * @param {google.cloud.datalabeling.v1beta1.IBoundingBoxEvaluationOptions} message BoundingBoxEvaluationOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxEvaluationOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingBoxEvaluationOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions} BoundingBoxEvaluationOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxEvaluationOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.iouThreshold = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingBoxEvaluationOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions} BoundingBoxEvaluationOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxEvaluationOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingBoxEvaluationOptions message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingBoxEvaluationOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + if (typeof message.iouThreshold !== "number") + return "iouThreshold: number expected"; + return null; + }; + + /** + * Creates a BoundingBoxEvaluationOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions} BoundingBoxEvaluationOptions + */ + BoundingBoxEvaluationOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions(); + if (object.iouThreshold != null) + message.iouThreshold = Number(object.iouThreshold); + return message; + }; + + /** + * Creates a plain object from a BoundingBoxEvaluationOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @static + * @param {google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions} message BoundingBoxEvaluationOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingBoxEvaluationOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.iouThreshold = 0; + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + object.iouThreshold = options.json && !isFinite(message.iouThreshold) ? String(message.iouThreshold) : message.iouThreshold; + return object; + }; + + /** + * Converts this BoundingBoxEvaluationOptions to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @instance + * @returns {Object.} JSON object + */ + BoundingBoxEvaluationOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingBoxEvaluationOptions + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingBoxEvaluationOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions"; + }; + + return BoundingBoxEvaluationOptions; + })(); + + v1beta1.EvaluationMetrics = (function() { + + /** + * Properties of an EvaluationMetrics. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IEvaluationMetrics + * @property {google.cloud.datalabeling.v1beta1.IClassificationMetrics|null} [classificationMetrics] EvaluationMetrics classificationMetrics + * @property {google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics|null} [objectDetectionMetrics] EvaluationMetrics objectDetectionMetrics + */ + + /** + * Constructs a new EvaluationMetrics. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an EvaluationMetrics. + * @implements IEvaluationMetrics + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IEvaluationMetrics=} [properties] Properties to set + */ + function EvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationMetrics classificationMetrics. + * @member {google.cloud.datalabeling.v1beta1.IClassificationMetrics|null|undefined} classificationMetrics + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @instance + */ + EvaluationMetrics.prototype.classificationMetrics = null; + + /** + * EvaluationMetrics objectDetectionMetrics. + * @member {google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics|null|undefined} objectDetectionMetrics + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @instance + */ + EvaluationMetrics.prototype.objectDetectionMetrics = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EvaluationMetrics metrics. + * @member {"classificationMetrics"|"objectDetectionMetrics"|undefined} metrics + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @instance + */ + Object.defineProperty(EvaluationMetrics.prototype, "metrics", { + get: $util.oneOfGetter($oneOfFields = ["classificationMetrics", "objectDetectionMetrics"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.EvaluationMetrics} EvaluationMetrics instance + */ + EvaluationMetrics.create = function create(properties) { + return new EvaluationMetrics(properties); + }; + + /** + * Encodes the specified EvaluationMetrics message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationMetrics} message EvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationMetrics != null && Object.hasOwnProperty.call(message, "classificationMetrics")) + $root.google.cloud.datalabeling.v1beta1.ClassificationMetrics.encode(message.classificationMetrics, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.objectDetectionMetrics != null && Object.hasOwnProperty.call(message, "objectDetectionMetrics")) + $root.google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.encode(message.objectDetectionMetrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationMetrics} message EvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.EvaluationMetrics} EvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.EvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.classificationMetrics = $root.google.cloud.datalabeling.v1beta1.ClassificationMetrics.decode(reader, reader.uint32()); + break; + } + case 2: { + message.objectDetectionMetrics = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.EvaluationMetrics} EvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationMetrics message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.classificationMetrics != null && message.hasOwnProperty("classificationMetrics")) { + properties.metrics = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ClassificationMetrics.verify(message.classificationMetrics); + if (error) + return "classificationMetrics." + error; + } + } + if (message.objectDetectionMetrics != null && message.hasOwnProperty("objectDetectionMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.verify(message.objectDetectionMetrics); + if (error) + return "objectDetectionMetrics." + error; + } + } + return null; + }; + + /** + * Creates an EvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.EvaluationMetrics} EvaluationMetrics + */ + EvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.EvaluationMetrics) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.EvaluationMetrics(); + if (object.classificationMetrics != null) { + if (typeof object.classificationMetrics !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationMetrics.classificationMetrics: object expected"); + message.classificationMetrics = $root.google.cloud.datalabeling.v1beta1.ClassificationMetrics.fromObject(object.classificationMetrics); + } + if (object.objectDetectionMetrics != null) { + if (typeof object.objectDetectionMetrics !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationMetrics.objectDetectionMetrics: object expected"); + message.objectDetectionMetrics = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.fromObject(object.objectDetectionMetrics); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.EvaluationMetrics} message EvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.classificationMetrics != null && message.hasOwnProperty("classificationMetrics")) { + object.classificationMetrics = $root.google.cloud.datalabeling.v1beta1.ClassificationMetrics.toObject(message.classificationMetrics, options); + if (options.oneofs) + object.metrics = "classificationMetrics"; + } + if (message.objectDetectionMetrics != null && message.hasOwnProperty("objectDetectionMetrics")) { + object.objectDetectionMetrics = $root.google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.toObject(message.objectDetectionMetrics, options); + if (options.oneofs) + object.metrics = "objectDetectionMetrics"; + } + return object; + }; + + /** + * Converts this EvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + EvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.EvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.EvaluationMetrics"; + }; + + return EvaluationMetrics; + })(); + + v1beta1.ClassificationMetrics = (function() { + + /** + * Properties of a ClassificationMetrics. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IClassificationMetrics + * @property {google.cloud.datalabeling.v1beta1.IPrCurve|null} [prCurve] ClassificationMetrics prCurve + * @property {google.cloud.datalabeling.v1beta1.IConfusionMatrix|null} [confusionMatrix] ClassificationMetrics confusionMatrix + */ + + /** + * Constructs a new ClassificationMetrics. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ClassificationMetrics. + * @implements IClassificationMetrics + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IClassificationMetrics=} [properties] Properties to set + */ + function ClassificationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationMetrics prCurve. + * @member {google.cloud.datalabeling.v1beta1.IPrCurve|null|undefined} prCurve + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @instance + */ + ClassificationMetrics.prototype.prCurve = null; + + /** + * ClassificationMetrics confusionMatrix. + * @member {google.cloud.datalabeling.v1beta1.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @instance + */ + ClassificationMetrics.prototype.confusionMatrix = null; + + /** + * Creates a new ClassificationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.IClassificationMetrics=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ClassificationMetrics} ClassificationMetrics instance + */ + ClassificationMetrics.create = function create(properties) { + return new ClassificationMetrics(properties); + }; + + /** + * Encodes the specified ClassificationMetrics message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ClassificationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.IClassificationMetrics} message ClassificationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prCurve != null && Object.hasOwnProperty.call(message, "prCurve")) + $root.google.cloud.datalabeling.v1beta1.PrCurve.encode(message.prCurve, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confusionMatrix != null && Object.hasOwnProperty.call(message, "confusionMatrix")) + $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClassificationMetrics message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ClassificationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.IClassificationMetrics} message ClassificationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ClassificationMetrics} ClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ClassificationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.prCurve = $root.google.cloud.datalabeling.v1beta1.PrCurve.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confusionMatrix = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ClassificationMetrics} ClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationMetrics message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prCurve != null && message.hasOwnProperty("prCurve")) { + var error = $root.google.cloud.datalabeling.v1beta1.PrCurve.verify(message.prCurve); + if (error) + return "prCurve." + error; + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + return null; + }; + + /** + * Creates a ClassificationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ClassificationMetrics} ClassificationMetrics + */ + ClassificationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ClassificationMetrics) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ClassificationMetrics(); + if (object.prCurve != null) { + if (typeof object.prCurve !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ClassificationMetrics.prCurve: object expected"); + message.prCurve = $root.google.cloud.datalabeling.v1beta1.PrCurve.fromObject(object.prCurve); + } + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ClassificationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.fromObject(object.confusionMatrix); + } + return message; + }; + + /** + * Creates a plain object from a ClassificationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.ClassificationMetrics} message ClassificationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.prCurve = null; + object.confusionMatrix = null; + } + if (message.prCurve != null && message.hasOwnProperty("prCurve")) + object.prCurve = $root.google.cloud.datalabeling.v1beta1.PrCurve.toObject(message.prCurve, options); + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.toObject(message.confusionMatrix, options); + return object; + }; + + /** + * Converts this ClassificationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @instance + * @returns {Object.} JSON object + */ + ClassificationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationMetrics + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ClassificationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ClassificationMetrics"; + }; + + return ClassificationMetrics; + })(); + + v1beta1.ObjectDetectionMetrics = (function() { + + /** + * Properties of an ObjectDetectionMetrics. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IObjectDetectionMetrics + * @property {google.cloud.datalabeling.v1beta1.IPrCurve|null} [prCurve] ObjectDetectionMetrics prCurve + */ + + /** + * Constructs a new ObjectDetectionMetrics. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ObjectDetectionMetrics. + * @implements IObjectDetectionMetrics + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics=} [properties] Properties to set + */ + function ObjectDetectionMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectDetectionMetrics prCurve. + * @member {google.cloud.datalabeling.v1beta1.IPrCurve|null|undefined} prCurve + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @instance + */ + ObjectDetectionMetrics.prototype.prCurve = null; + + /** + * Creates a new ObjectDetectionMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics} ObjectDetectionMetrics instance + */ + ObjectDetectionMetrics.create = function create(properties) { + return new ObjectDetectionMetrics(properties); + }; + + /** + * Encodes the specified ObjectDetectionMetrics message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics} message ObjectDetectionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectDetectionMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prCurve != null && Object.hasOwnProperty.call(message, "prCurve")) + $root.google.cloud.datalabeling.v1beta1.PrCurve.encode(message.prCurve, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ObjectDetectionMetrics message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.IObjectDetectionMetrics} message ObjectDetectionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectDetectionMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectDetectionMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics} ObjectDetectionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectDetectionMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.prCurve = $root.google.cloud.datalabeling.v1beta1.PrCurve.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectDetectionMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics} ObjectDetectionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectDetectionMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectDetectionMetrics message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectDetectionMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prCurve != null && message.hasOwnProperty("prCurve")) { + var error = $root.google.cloud.datalabeling.v1beta1.PrCurve.verify(message.prCurve); + if (error) + return "prCurve." + error; + } + return null; + }; + + /** + * Creates an ObjectDetectionMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics} ObjectDetectionMetrics + */ + ObjectDetectionMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics(); + if (object.prCurve != null) { + if (typeof object.prCurve !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.prCurve: object expected"); + message.prCurve = $root.google.cloud.datalabeling.v1beta1.PrCurve.fromObject(object.prCurve); + } + return message; + }; + + /** + * Creates a plain object from an ObjectDetectionMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @static + * @param {google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics} message ObjectDetectionMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectDetectionMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prCurve = null; + if (message.prCurve != null && message.hasOwnProperty("prCurve")) + object.prCurve = $root.google.cloud.datalabeling.v1beta1.PrCurve.toObject(message.prCurve, options); + return object; + }; + + /** + * Converts this ObjectDetectionMetrics to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @instance + * @returns {Object.} JSON object + */ + ObjectDetectionMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectDetectionMetrics + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectDetectionMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics"; + }; + + return ObjectDetectionMetrics; + })(); + + v1beta1.PrCurve = (function() { + + /** + * Properties of a PrCurve. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IPrCurve + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] PrCurve annotationSpec + * @property {number|null} [areaUnderCurve] PrCurve areaUnderCurve + * @property {Array.|null} [confidenceMetricsEntries] PrCurve confidenceMetricsEntries + * @property {number|null} [meanAveragePrecision] PrCurve meanAveragePrecision + */ + + /** + * Constructs a new PrCurve. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a PrCurve. + * @implements IPrCurve + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IPrCurve=} [properties] Properties to set + */ + function PrCurve(properties) { + this.confidenceMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrCurve annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @instance + */ + PrCurve.prototype.annotationSpec = null; + + /** + * PrCurve areaUnderCurve. + * @member {number} areaUnderCurve + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @instance + */ + PrCurve.prototype.areaUnderCurve = 0; + + /** + * PrCurve confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @instance + */ + PrCurve.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * PrCurve meanAveragePrecision. + * @member {number} meanAveragePrecision + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @instance + */ + PrCurve.prototype.meanAveragePrecision = 0; + + /** + * Creates a new PrCurve instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @static + * @param {google.cloud.datalabeling.v1beta1.IPrCurve=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.PrCurve} PrCurve instance + */ + PrCurve.create = function create(properties) { + return new PrCurve(properties); + }; + + /** + * Encodes the specified PrCurve message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PrCurve.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @static + * @param {google.cloud.datalabeling.v1beta1.IPrCurve} message PrCurve message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrCurve.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.areaUnderCurve != null && Object.hasOwnProperty.call(message, "areaUnderCurve")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.areaUnderCurve); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.meanAveragePrecision != null && Object.hasOwnProperty.call(message, "meanAveragePrecision")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.meanAveragePrecision); + return writer; + }; + + /** + * Encodes the specified PrCurve message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PrCurve.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @static + * @param {google.cloud.datalabeling.v1beta1.IPrCurve} message PrCurve message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrCurve.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrCurve message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.PrCurve} PrCurve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrCurve.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.PrCurve(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.areaUnderCurve = reader.float(); + break; + } + case 3: { + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 4: { + message.meanAveragePrecision = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrCurve message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.PrCurve} PrCurve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrCurve.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrCurve message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrCurve.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + if (message.areaUnderCurve != null && message.hasOwnProperty("areaUnderCurve")) + if (typeof message.areaUnderCurve !== "number") + return "areaUnderCurve: number expected"; + if (message.confidenceMetricsEntries != null && message.hasOwnProperty("confidenceMetricsEntries")) { + if (!Array.isArray(message.confidenceMetricsEntries)) + return "confidenceMetricsEntries: array expected"; + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + if (typeof message.meanAveragePrecision !== "number") + return "meanAveragePrecision: number expected"; + return null; + }; + + /** + * Creates a PrCurve message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.PrCurve} PrCurve + */ + PrCurve.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.PrCurve) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.PrCurve(); + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.PrCurve.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + if (object.areaUnderCurve != null) + message.areaUnderCurve = Number(object.areaUnderCurve); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.datalabeling.v1beta1.PrCurve.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.PrCurve.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + if (object.meanAveragePrecision != null) + message.meanAveragePrecision = Number(object.meanAveragePrecision); + return message; + }; + + /** + * Creates a plain object from a PrCurve message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @static + * @param {google.cloud.datalabeling.v1beta1.PrCurve} message PrCurve + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrCurve.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) { + object.annotationSpec = null; + object.areaUnderCurve = 0; + object.meanAveragePrecision = 0; + } + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + if (message.areaUnderCurve != null && message.hasOwnProperty("areaUnderCurve")) + object.areaUnderCurve = options.json && !isFinite(message.areaUnderCurve) ? String(message.areaUnderCurve) : message.areaUnderCurve; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + object.meanAveragePrecision = options.json && !isFinite(message.meanAveragePrecision) ? String(message.meanAveragePrecision) : message.meanAveragePrecision; + return object; + }; + + /** + * Converts this PrCurve to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @instance + * @returns {Object.} JSON object + */ + PrCurve.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrCurve + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrCurve.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.PrCurve"; + }; + + PrCurve.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + * @property {number|null} [recallAt1] ConfidenceMetricsEntry recallAt1 + * @property {number|null} [precisionAt1] ConfidenceMetricsEntry precisionAt1 + * @property {number|null} [f1ScoreAt1] ConfidenceMetricsEntry f1ScoreAt1 + * @property {number|null} [recallAt5] ConfidenceMetricsEntry recallAt5 + * @property {number|null} [precisionAt5] ConfidenceMetricsEntry precisionAt5 + * @property {number|null} [f1ScoreAt5] ConfidenceMetricsEntry f1ScoreAt5 + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.datalabeling.v1beta1.PrCurve + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * ConfidenceMetricsEntry recallAt1. + * @member {number} recallAt1 + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recallAt1 = 0; + + /** + * ConfidenceMetricsEntry precisionAt1. + * @member {number} precisionAt1 + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precisionAt1 = 0; + + /** + * ConfidenceMetricsEntry f1ScoreAt1. + * @member {number} f1ScoreAt1 + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1ScoreAt1 = 0; + + /** + * ConfidenceMetricsEntry recallAt5. + * @member {number} recallAt5 + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recallAt5 = 0; + + /** + * ConfidenceMetricsEntry precisionAt5. + * @member {number} precisionAt5 + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precisionAt5 = 0; + + /** + * ConfidenceMetricsEntry f1ScoreAt5. + * @member {number} f1ScoreAt5 + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1ScoreAt5 = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @static + * @param {google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @static + * @param {google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.precision); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.f1Score); + if (message.recallAt1 != null && Object.hasOwnProperty.call(message, "recallAt1")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.recallAt1); + if (message.precisionAt1 != null && Object.hasOwnProperty.call(message, "precisionAt1")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.precisionAt1); + if (message.f1ScoreAt1 != null && Object.hasOwnProperty.call(message, "f1ScoreAt1")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.f1ScoreAt1); + if (message.recallAt5 != null && Object.hasOwnProperty.call(message, "recallAt5")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.recallAt5); + if (message.precisionAt5 != null && Object.hasOwnProperty.call(message, "precisionAt5")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.precisionAt5); + if (message.f1ScoreAt5 != null && Object.hasOwnProperty.call(message, "f1ScoreAt5")) + writer.uint32(/* id 10, wireType 5 =*/85).float(message.f1ScoreAt5); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @static + * @param {google.cloud.datalabeling.v1beta1.PrCurve.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.precision = reader.float(); + break; + } + case 4: { + message.f1Score = reader.float(); + break; + } + case 5: { + message.recallAt1 = reader.float(); + break; + } + case 6: { + message.precisionAt1 = reader.float(); + break; + } + case 7: { + message.f1ScoreAt1 = reader.float(); + break; + } + case 8: { + message.recallAt5 = reader.float(); + break; + } + case 9: { + message.precisionAt5 = reader.float(); + break; + } + case 10: { + message.f1ScoreAt5 = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.recallAt1 != null && message.hasOwnProperty("recallAt1")) + if (typeof message.recallAt1 !== "number") + return "recallAt1: number expected"; + if (message.precisionAt1 != null && message.hasOwnProperty("precisionAt1")) + if (typeof message.precisionAt1 !== "number") + return "precisionAt1: number expected"; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + if (typeof message.f1ScoreAt1 !== "number") + return "f1ScoreAt1: number expected"; + if (message.recallAt5 != null && message.hasOwnProperty("recallAt5")) + if (typeof message.recallAt5 !== "number") + return "recallAt5: number expected"; + if (message.precisionAt5 != null && message.hasOwnProperty("precisionAt5")) + if (typeof message.precisionAt5 !== "number") + return "precisionAt5: number expected"; + if (message.f1ScoreAt5 != null && message.hasOwnProperty("f1ScoreAt5")) + if (typeof message.f1ScoreAt5 !== "number") + return "f1ScoreAt5: number expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.recallAt1 != null) + message.recallAt1 = Number(object.recallAt1); + if (object.precisionAt1 != null) + message.precisionAt1 = Number(object.precisionAt1); + if (object.f1ScoreAt1 != null) + message.f1ScoreAt1 = Number(object.f1ScoreAt1); + if (object.recallAt5 != null) + message.recallAt5 = Number(object.recallAt5); + if (object.precisionAt5 != null) + message.precisionAt5 = Number(object.precisionAt5); + if (object.f1ScoreAt5 != null) + message.f1ScoreAt5 = Number(object.f1ScoreAt5); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @static + * @param {google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + object.recallAt1 = 0; + object.precisionAt1 = 0; + object.f1ScoreAt1 = 0; + object.recallAt5 = 0; + object.precisionAt5 = 0; + object.f1ScoreAt5 = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.recallAt1 != null && message.hasOwnProperty("recallAt1")) + object.recallAt1 = options.json && !isFinite(message.recallAt1) ? String(message.recallAt1) : message.recallAt1; + if (message.precisionAt1 != null && message.hasOwnProperty("precisionAt1")) + object.precisionAt1 = options.json && !isFinite(message.precisionAt1) ? String(message.precisionAt1) : message.precisionAt1; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + object.f1ScoreAt1 = options.json && !isFinite(message.f1ScoreAt1) ? String(message.f1ScoreAt1) : message.f1ScoreAt1; + if (message.recallAt5 != null && message.hasOwnProperty("recallAt5")) + object.recallAt5 = options.json && !isFinite(message.recallAt5) ? String(message.recallAt5) : message.recallAt5; + if (message.precisionAt5 != null && message.hasOwnProperty("precisionAt5")) + object.precisionAt5 = options.json && !isFinite(message.precisionAt5) ? String(message.precisionAt5) : message.precisionAt5; + if (message.f1ScoreAt5 != null && message.hasOwnProperty("f1ScoreAt5")) + object.f1ScoreAt5 = options.json && !isFinite(message.f1ScoreAt5) ? String(message.f1ScoreAt5) : message.f1ScoreAt5; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + return PrCurve; + })(); + + v1beta1.ConfusionMatrix = (function() { + + /** + * Properties of a ConfusionMatrix. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IConfusionMatrix + * @property {Array.|null} [row] ConfusionMatrix row + */ + + /** + * Constructs a new ConfusionMatrix. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a ConfusionMatrix. + * @implements IConfusionMatrix + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IConfusionMatrix=} [properties] Properties to set + */ + function ConfusionMatrix(properties) { + this.row = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfusionMatrix row. + * @member {Array.} row + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.row = $util.emptyArray; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @static + * @param {google.cloud.datalabeling.v1beta1.IConfusionMatrix=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix} ConfusionMatrix instance + */ + ConfusionMatrix.create = function create(properties) { + return new ConfusionMatrix(properties); + }; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @static + * @param {google.cloud.datalabeling.v1beta1.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.row != null && message.row.length) + for (var i = 0; i < message.row.length; ++i) + $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.encode(message.row[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @static + * @param {google.cloud.datalabeling.v1beta1.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.row && message.row.length)) + message.row = []; + message.row.push($root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfusionMatrix message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfusionMatrix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.row != null && message.hasOwnProperty("row")) { + if (!Array.isArray(message.row)) + return "row: array expected"; + for (var i = 0; i < message.row.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.verify(message.row[i]); + if (error) + return "row." + error; + } + } + return null; + }; + + /** + * Creates a ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix} ConfusionMatrix + */ + ConfusionMatrix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix(); + if (object.row) { + if (!Array.isArray(object.row)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ConfusionMatrix.row: array expected"); + message.row = []; + for (var i = 0; i < object.row.length; ++i) { + if (typeof object.row[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ConfusionMatrix.row: object expected"); + message.row[i] = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.fromObject(object.row[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @static + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix} message ConfusionMatrix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfusionMatrix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.row = []; + if (message.row && message.row.length) { + object.row = []; + for (var j = 0; j < message.row.length; ++j) + object.row[j] = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.toObject(message.row[j], options); + } + return object; + }; + + /** + * Converts this ConfusionMatrix to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @instance + * @returns {Object.} JSON object + */ + ConfusionMatrix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfusionMatrix + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfusionMatrix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ConfusionMatrix"; + }; + + ConfusionMatrix.ConfusionMatrixEntry = (function() { + + /** + * Properties of a ConfusionMatrixEntry. + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @interface IConfusionMatrixEntry + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] ConfusionMatrixEntry annotationSpec + * @property {number|null} [itemCount] ConfusionMatrixEntry itemCount + */ + + /** + * Constructs a new ConfusionMatrixEntry. + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @classdesc Represents a ConfusionMatrixEntry. + * @implements IConfusionMatrixEntry + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry=} [properties] Properties to set + */ + function ConfusionMatrixEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfusionMatrixEntry annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @instance + */ + ConfusionMatrixEntry.prototype.annotationSpec = null; + + /** + * ConfusionMatrixEntry itemCount. + * @member {number} itemCount + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @instance + */ + ConfusionMatrixEntry.prototype.itemCount = 0; + + /** + * Creates a new ConfusionMatrixEntry instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @static + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry} ConfusionMatrixEntry instance + */ + ConfusionMatrixEntry.create = function create(properties) { + return new ConfusionMatrixEntry(properties); + }; + + /** + * Encodes the specified ConfusionMatrixEntry message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @static + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry} message ConfusionMatrixEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrixEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.itemCount != null && Object.hasOwnProperty.call(message, "itemCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.itemCount); + return writer; + }; + + /** + * Encodes the specified ConfusionMatrixEntry message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @static + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.IConfusionMatrixEntry} message ConfusionMatrixEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrixEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfusionMatrixEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry} ConfusionMatrixEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrixEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.itemCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfusionMatrixEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry} ConfusionMatrixEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrixEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfusionMatrixEntry message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfusionMatrixEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + if (message.itemCount != null && message.hasOwnProperty("itemCount")) + if (!$util.isInteger(message.itemCount)) + return "itemCount: integer expected"; + return null; + }; + + /** + * Creates a ConfusionMatrixEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry} ConfusionMatrixEntry + */ + ConfusionMatrixEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry(); + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + if (object.itemCount != null) + message.itemCount = object.itemCount | 0; + return message; + }; + + /** + * Creates a plain object from a ConfusionMatrixEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @static + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry} message ConfusionMatrixEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfusionMatrixEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpec = null; + object.itemCount = 0; + } + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + if (message.itemCount != null && message.hasOwnProperty("itemCount")) + object.itemCount = message.itemCount; + return object; + }; + + /** + * Converts this ConfusionMatrixEntry to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @instance + * @returns {Object.} JSON object + */ + ConfusionMatrixEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfusionMatrixEntry + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfusionMatrixEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry"; + }; + + return ConfusionMatrixEntry; + })(); + + ConfusionMatrix.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @interface IRow + * @property {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null} [annotationSpec] Row annotationSpec + * @property {Array.|null} [entries] Row entries + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row annotationSpec. + * @member {google.cloud.datalabeling.v1beta1.IAnnotationSpec|null|undefined} annotationSpec + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @instance + */ + Row.prototype.annotationSpec = null; + + /** + * Row entries. + * @member {Array.} entries + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @instance + */ + Row.prototype.entries = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @static + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @static + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpec != null && Object.hasOwnProperty.call(message, "annotationSpec")) + $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.encode(message.annotationSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @static + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) { + var error = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.verify(message.annotationSpec); + if (error) + return "annotationSpec." + error; + } + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row(); + if (object.annotationSpec != null) { + if (typeof object.annotationSpec !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.annotationSpec: object expected"); + message.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.fromObject(object.annotationSpec); + } + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.entries: object expected"); + message.entries[i] = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @static + * @param {google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) + object.annotationSpec = null; + if (message.annotationSpec != null && message.hasOwnProperty("annotationSpec")) + object.annotationSpec = $root.google.cloud.datalabeling.v1beta1.AnnotationSpec.toObject(message.annotationSpec, options); + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row"; + }; + + return Row; + })(); + + return ConfusionMatrix; + })(); + + v1beta1.EvaluationJob = (function() { + + /** + * Properties of an EvaluationJob. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IEvaluationJob + * @property {string|null} [name] EvaluationJob name + * @property {string|null} [description] EvaluationJob description + * @property {google.cloud.datalabeling.v1beta1.EvaluationJob.State|null} [state] EvaluationJob state + * @property {string|null} [schedule] EvaluationJob schedule + * @property {string|null} [modelVersion] EvaluationJob modelVersion + * @property {google.cloud.datalabeling.v1beta1.IEvaluationJobConfig|null} [evaluationJobConfig] EvaluationJob evaluationJobConfig + * @property {string|null} [annotationSpecSet] EvaluationJob annotationSpecSet + * @property {boolean|null} [labelMissingGroundTruth] EvaluationJob labelMissingGroundTruth + * @property {Array.|null} [attempts] EvaluationJob attempts + * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationJob createTime + */ + + /** + * Constructs a new EvaluationJob. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an EvaluationJob. + * @implements IEvaluationJob + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJob=} [properties] Properties to set + */ + function EvaluationJob(properties) { + this.attempts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationJob name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.name = ""; + + /** + * EvaluationJob description. + * @member {string} description + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.description = ""; + + /** + * EvaluationJob state. + * @member {google.cloud.datalabeling.v1beta1.EvaluationJob.State} state + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.state = 0; + + /** + * EvaluationJob schedule. + * @member {string} schedule + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.schedule = ""; + + /** + * EvaluationJob modelVersion. + * @member {string} modelVersion + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.modelVersion = ""; + + /** + * EvaluationJob evaluationJobConfig. + * @member {google.cloud.datalabeling.v1beta1.IEvaluationJobConfig|null|undefined} evaluationJobConfig + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.evaluationJobConfig = null; + + /** + * EvaluationJob annotationSpecSet. + * @member {string} annotationSpecSet + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.annotationSpecSet = ""; + + /** + * EvaluationJob labelMissingGroundTruth. + * @member {boolean} labelMissingGroundTruth + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.labelMissingGroundTruth = false; + + /** + * EvaluationJob attempts. + * @member {Array.} attempts + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.attempts = $util.emptyArray; + + /** + * EvaluationJob createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + */ + EvaluationJob.prototype.createTime = null; + + /** + * Creates a new EvaluationJob instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJob=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJob} EvaluationJob instance + */ + EvaluationJob.create = function create(properties) { + return new EvaluationJob(properties); + }; + + /** + * Encodes the specified EvaluationJob message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJob} message EvaluationJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationJob.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.schedule); + if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.modelVersion); + if (message.evaluationJobConfig != null && Object.hasOwnProperty.call(message, "evaluationJobConfig")) + $root.google.cloud.datalabeling.v1beta1.EvaluationJobConfig.encode(message.evaluationJobConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.annotationSpecSet != null && Object.hasOwnProperty.call(message, "annotationSpecSet")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.annotationSpecSet); + if (message.labelMissingGroundTruth != null && Object.hasOwnProperty.call(message, "labelMissingGroundTruth")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.labelMissingGroundTruth); + if (message.attempts != null && message.attempts.length) + for (var i = 0; i < message.attempts.length; ++i) + $root.google.cloud.datalabeling.v1beta1.Attempt.encode(message.attempts[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationJob message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJob} message EvaluationJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJob} EvaluationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.EvaluationJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.schedule = reader.string(); + break; + } + case 5: { + message.modelVersion = reader.string(); + break; + } + case 6: { + message.evaluationJobConfig = $root.google.cloud.datalabeling.v1beta1.EvaluationJobConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.annotationSpecSet = reader.string(); + break; + } + case 8: { + message.labelMissingGroundTruth = reader.bool(); + break; + } + case 9: { + if (!(message.attempts && message.attempts.length)) + message.attempts = []; + message.attempts.push($root.google.cloud.datalabeling.v1beta1.Attempt.decode(reader, reader.uint32())); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJob} EvaluationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationJob message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + if (!$util.isString(message.modelVersion)) + return "modelVersion: string expected"; + if (message.evaluationJobConfig != null && message.hasOwnProperty("evaluationJobConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.EvaluationJobConfig.verify(message.evaluationJobConfig); + if (error) + return "evaluationJobConfig." + error; + } + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + if (!$util.isString(message.annotationSpecSet)) + return "annotationSpecSet: string expected"; + if (message.labelMissingGroundTruth != null && message.hasOwnProperty("labelMissingGroundTruth")) + if (typeof message.labelMissingGroundTruth !== "boolean") + return "labelMissingGroundTruth: boolean expected"; + if (message.attempts != null && message.hasOwnProperty("attempts")) { + if (!Array.isArray(message.attempts)) + return "attempts: array expected"; + for (var i = 0; i < message.attempts.length; ++i) { + var error = $root.google.cloud.datalabeling.v1beta1.Attempt.verify(message.attempts[i]); + if (error) + return "attempts." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates an EvaluationJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJob} EvaluationJob + */ + EvaluationJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.EvaluationJob) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.EvaluationJob(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "SCHEDULED": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "PAUSED": + case 3: + message.state = 3; + break; + case "STOPPED": + case 4: + message.state = 4; + break; + } + if (object.schedule != null) + message.schedule = String(object.schedule); + if (object.modelVersion != null) + message.modelVersion = String(object.modelVersion); + if (object.evaluationJobConfig != null) { + if (typeof object.evaluationJobConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJob.evaluationJobConfig: object expected"); + message.evaluationJobConfig = $root.google.cloud.datalabeling.v1beta1.EvaluationJobConfig.fromObject(object.evaluationJobConfig); + } + if (object.annotationSpecSet != null) + message.annotationSpecSet = String(object.annotationSpecSet); + if (object.labelMissingGroundTruth != null) + message.labelMissingGroundTruth = Boolean(object.labelMissingGroundTruth); + if (object.attempts) { + if (!Array.isArray(object.attempts)) + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJob.attempts: array expected"); + message.attempts = []; + for (var i = 0; i < object.attempts.length; ++i) { + if (typeof object.attempts[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJob.attempts: object expected"); + message.attempts[i] = $root.google.cloud.datalabeling.v1beta1.Attempt.fromObject(object.attempts[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJob.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @static + * @param {google.cloud.datalabeling.v1beta1.EvaluationJob} message EvaluationJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attempts = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.schedule = ""; + object.modelVersion = ""; + object.evaluationJobConfig = null; + object.annotationSpecSet = ""; + object.labelMissingGroundTruth = false; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.EvaluationJob.State[message.state] === undefined ? message.state : $root.google.cloud.datalabeling.v1beta1.EvaluationJob.State[message.state] : message.state; + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = message.schedule; + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + object.modelVersion = message.modelVersion; + if (message.evaluationJobConfig != null && message.hasOwnProperty("evaluationJobConfig")) + object.evaluationJobConfig = $root.google.cloud.datalabeling.v1beta1.EvaluationJobConfig.toObject(message.evaluationJobConfig, options); + if (message.annotationSpecSet != null && message.hasOwnProperty("annotationSpecSet")) + object.annotationSpecSet = message.annotationSpecSet; + if (message.labelMissingGroundTruth != null && message.hasOwnProperty("labelMissingGroundTruth")) + object.labelMissingGroundTruth = message.labelMissingGroundTruth; + if (message.attempts && message.attempts.length) { + object.attempts = []; + for (var j = 0; j < message.attempts.length; ++j) + object.attempts[j] = $root.google.cloud.datalabeling.v1beta1.Attempt.toObject(message.attempts[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this EvaluationJob to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @instance + * @returns {Object.} JSON object + */ + EvaluationJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationJob + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.EvaluationJob"; + }; + + /** + * State enum. + * @name google.cloud.datalabeling.v1beta1.EvaluationJob.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SCHEDULED=1 SCHEDULED value + * @property {number} RUNNING=2 RUNNING value + * @property {number} PAUSED=3 PAUSED value + * @property {number} STOPPED=4 STOPPED value + */ + EvaluationJob.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCHEDULED"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "PAUSED"] = 3; + values[valuesById[4] = "STOPPED"] = 4; + return values; + })(); + + return EvaluationJob; + })(); + + v1beta1.EvaluationJobConfig = (function() { + + /** + * Properties of an EvaluationJobConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IEvaluationJobConfig + * @property {google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null} [imageClassificationConfig] EvaluationJobConfig imageClassificationConfig + * @property {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null} [boundingPolyConfig] EvaluationJobConfig boundingPolyConfig + * @property {google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null} [textClassificationConfig] EvaluationJobConfig textClassificationConfig + * @property {google.cloud.datalabeling.v1beta1.IInputConfig|null} [inputConfig] EvaluationJobConfig inputConfig + * @property {google.cloud.datalabeling.v1beta1.IEvaluationConfig|null} [evaluationConfig] EvaluationJobConfig evaluationConfig + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [humanAnnotationConfig] EvaluationJobConfig humanAnnotationConfig + * @property {Object.|null} [bigqueryImportKeys] EvaluationJobConfig bigqueryImportKeys + * @property {number|null} [exampleCount] EvaluationJobConfig exampleCount + * @property {number|null} [exampleSamplePercentage] EvaluationJobConfig exampleSamplePercentage + * @property {google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig|null} [evaluationJobAlertConfig] EvaluationJobConfig evaluationJobAlertConfig + */ + + /** + * Constructs a new EvaluationJobConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an EvaluationJobConfig. + * @implements IEvaluationJobConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJobConfig=} [properties] Properties to set + */ + function EvaluationJobConfig(properties) { + this.bigqueryImportKeys = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationJobConfig imageClassificationConfig. + * @member {google.cloud.datalabeling.v1beta1.IImageClassificationConfig|null|undefined} imageClassificationConfig + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.imageClassificationConfig = null; + + /** + * EvaluationJobConfig boundingPolyConfig. + * @member {google.cloud.datalabeling.v1beta1.IBoundingPolyConfig|null|undefined} boundingPolyConfig + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.boundingPolyConfig = null; + + /** + * EvaluationJobConfig textClassificationConfig. + * @member {google.cloud.datalabeling.v1beta1.ITextClassificationConfig|null|undefined} textClassificationConfig + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.textClassificationConfig = null; + + /** + * EvaluationJobConfig inputConfig. + * @member {google.cloud.datalabeling.v1beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.inputConfig = null; + + /** + * EvaluationJobConfig evaluationConfig. + * @member {google.cloud.datalabeling.v1beta1.IEvaluationConfig|null|undefined} evaluationConfig + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.evaluationConfig = null; + + /** + * EvaluationJobConfig humanAnnotationConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} humanAnnotationConfig + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.humanAnnotationConfig = null; + + /** + * EvaluationJobConfig bigqueryImportKeys. + * @member {Object.} bigqueryImportKeys + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.bigqueryImportKeys = $util.emptyObject; + + /** + * EvaluationJobConfig exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.exampleCount = 0; + + /** + * EvaluationJobConfig exampleSamplePercentage. + * @member {number} exampleSamplePercentage + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.exampleSamplePercentage = 0; + + /** + * EvaluationJobConfig evaluationJobAlertConfig. + * @member {google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig|null|undefined} evaluationJobAlertConfig + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + EvaluationJobConfig.prototype.evaluationJobAlertConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EvaluationJobConfig humanAnnotationRequestConfig. + * @member {"imageClassificationConfig"|"boundingPolyConfig"|"textClassificationConfig"|undefined} humanAnnotationRequestConfig + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + */ + Object.defineProperty(EvaluationJobConfig.prototype, "humanAnnotationRequestConfig", { + get: $util.oneOfGetter($oneOfFields = ["imageClassificationConfig", "boundingPolyConfig", "textClassificationConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EvaluationJobConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJobConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJobConfig} EvaluationJobConfig instance + */ + EvaluationJobConfig.create = function create(properties) { + return new EvaluationJobConfig(properties); + }; + + /** + * Encodes the specified EvaluationJobConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJobConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJobConfig} message EvaluationJobConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationJobConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.datalabeling.v1beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evaluationConfig != null && Object.hasOwnProperty.call(message, "evaluationConfig")) + $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.encode(message.evaluationConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.humanAnnotationConfig != null && Object.hasOwnProperty.call(message, "humanAnnotationConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.humanAnnotationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.imageClassificationConfig != null && Object.hasOwnProperty.call(message, "imageClassificationConfig")) + $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.encode(message.imageClassificationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.boundingPolyConfig != null && Object.hasOwnProperty.call(message, "boundingPolyConfig")) + $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.encode(message.boundingPolyConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.textClassificationConfig != null && Object.hasOwnProperty.call(message, "textClassificationConfig")) + $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.encode(message.textClassificationConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.bigqueryImportKeys != null && Object.hasOwnProperty.call(message, "bigqueryImportKeys")) + for (var keys = Object.keys(message.bigqueryImportKeys), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.bigqueryImportKeys[keys[i]]).ldelim(); + if (message.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.exampleCount); + if (message.exampleSamplePercentage != null && Object.hasOwnProperty.call(message, "exampleSamplePercentage")) + writer.uint32(/* id 11, wireType 1 =*/89).double(message.exampleSamplePercentage); + if (message.evaluationJobAlertConfig != null && Object.hasOwnProperty.call(message, "evaluationJobAlertConfig")) + $root.google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig.encode(message.evaluationJobAlertConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationJobConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJobConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJobConfig} message EvaluationJobConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationJobConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationJobConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJobConfig} EvaluationJobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationJobConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.EvaluationJobConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.imageClassificationConfig = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.boundingPolyConfig = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.textClassificationConfig = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.decode(reader, reader.uint32()); + break; + } + case 1: { + message.inputConfig = $root.google.cloud.datalabeling.v1beta1.InputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.evaluationConfig = $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.humanAnnotationConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.bigqueryImportKeys === $util.emptyObject) + message.bigqueryImportKeys = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.bigqueryImportKeys[key] = value; + break; + } + case 10: { + message.exampleCount = reader.int32(); + break; + } + case 11: { + message.exampleSamplePercentage = reader.double(); + break; + } + case 13: { + message.evaluationJobAlertConfig = $root.google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationJobConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJobConfig} EvaluationJobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationJobConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationJobConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationJobConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageClassificationConfig != null && message.hasOwnProperty("imageClassificationConfig")) { + properties.humanAnnotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.verify(message.imageClassificationConfig); + if (error) + return "imageClassificationConfig." + error; + } + } + if (message.boundingPolyConfig != null && message.hasOwnProperty("boundingPolyConfig")) { + if (properties.humanAnnotationRequestConfig === 1) + return "humanAnnotationRequestConfig: multiple values"; + properties.humanAnnotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.verify(message.boundingPolyConfig); + if (error) + return "boundingPolyConfig." + error; + } + } + if (message.textClassificationConfig != null && message.hasOwnProperty("textClassificationConfig")) { + if (properties.humanAnnotationRequestConfig === 1) + return "humanAnnotationRequestConfig: multiple values"; + properties.humanAnnotationRequestConfig = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.verify(message.textClassificationConfig); + if (error) + return "textClassificationConfig." + error; + } + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.evaluationConfig != null && message.hasOwnProperty("evaluationConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.verify(message.evaluationConfig); + if (error) + return "evaluationConfig." + error; + } + if (message.humanAnnotationConfig != null && message.hasOwnProperty("humanAnnotationConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.humanAnnotationConfig); + if (error) + return "humanAnnotationConfig." + error; + } + if (message.bigqueryImportKeys != null && message.hasOwnProperty("bigqueryImportKeys")) { + if (!$util.isObject(message.bigqueryImportKeys)) + return "bigqueryImportKeys: object expected"; + var key = Object.keys(message.bigqueryImportKeys); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.bigqueryImportKeys[key[i]])) + return "bigqueryImportKeys: string{k:string} expected"; + } + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + if (message.exampleSamplePercentage != null && message.hasOwnProperty("exampleSamplePercentage")) + if (typeof message.exampleSamplePercentage !== "number") + return "exampleSamplePercentage: number expected"; + if (message.evaluationJobAlertConfig != null && message.hasOwnProperty("evaluationJobAlertConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig.verify(message.evaluationJobAlertConfig); + if (error) + return "evaluationJobAlertConfig." + error; + } + return null; + }; + + /** + * Creates an EvaluationJobConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJobConfig} EvaluationJobConfig + */ + EvaluationJobConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.EvaluationJobConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.EvaluationJobConfig(); + if (object.imageClassificationConfig != null) { + if (typeof object.imageClassificationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJobConfig.imageClassificationConfig: object expected"); + message.imageClassificationConfig = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.fromObject(object.imageClassificationConfig); + } + if (object.boundingPolyConfig != null) { + if (typeof object.boundingPolyConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJobConfig.boundingPolyConfig: object expected"); + message.boundingPolyConfig = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.fromObject(object.boundingPolyConfig); + } + if (object.textClassificationConfig != null) { + if (typeof object.textClassificationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJobConfig.textClassificationConfig: object expected"); + message.textClassificationConfig = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.fromObject(object.textClassificationConfig); + } + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJobConfig.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.datalabeling.v1beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.evaluationConfig != null) { + if (typeof object.evaluationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJobConfig.evaluationConfig: object expected"); + message.evaluationConfig = $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.fromObject(object.evaluationConfig); + } + if (object.humanAnnotationConfig != null) { + if (typeof object.humanAnnotationConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJobConfig.humanAnnotationConfig: object expected"); + message.humanAnnotationConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.humanAnnotationConfig); + } + if (object.bigqueryImportKeys) { + if (typeof object.bigqueryImportKeys !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJobConfig.bigqueryImportKeys: object expected"); + message.bigqueryImportKeys = {}; + for (var keys = Object.keys(object.bigqueryImportKeys), i = 0; i < keys.length; ++i) + message.bigqueryImportKeys[keys[i]] = String(object.bigqueryImportKeys[keys[i]]); + } + if (object.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + if (object.exampleSamplePercentage != null) + message.exampleSamplePercentage = Number(object.exampleSamplePercentage); + if (object.evaluationJobAlertConfig != null) { + if (typeof object.evaluationJobAlertConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.EvaluationJobConfig.evaluationJobAlertConfig: object expected"); + message.evaluationJobAlertConfig = $root.google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig.fromObject(object.evaluationJobAlertConfig); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationJobConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.EvaluationJobConfig} message EvaluationJobConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationJobConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.bigqueryImportKeys = {}; + if (options.defaults) { + object.inputConfig = null; + object.evaluationConfig = null; + object.humanAnnotationConfig = null; + object.exampleCount = 0; + object.exampleSamplePercentage = 0; + object.evaluationJobAlertConfig = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.datalabeling.v1beta1.InputConfig.toObject(message.inputConfig, options); + if (message.evaluationConfig != null && message.hasOwnProperty("evaluationConfig")) + object.evaluationConfig = $root.google.cloud.datalabeling.v1beta1.EvaluationConfig.toObject(message.evaluationConfig, options); + if (message.humanAnnotationConfig != null && message.hasOwnProperty("humanAnnotationConfig")) + object.humanAnnotationConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.humanAnnotationConfig, options); + if (message.imageClassificationConfig != null && message.hasOwnProperty("imageClassificationConfig")) { + object.imageClassificationConfig = $root.google.cloud.datalabeling.v1beta1.ImageClassificationConfig.toObject(message.imageClassificationConfig, options); + if (options.oneofs) + object.humanAnnotationRequestConfig = "imageClassificationConfig"; + } + if (message.boundingPolyConfig != null && message.hasOwnProperty("boundingPolyConfig")) { + object.boundingPolyConfig = $root.google.cloud.datalabeling.v1beta1.BoundingPolyConfig.toObject(message.boundingPolyConfig, options); + if (options.oneofs) + object.humanAnnotationRequestConfig = "boundingPolyConfig"; + } + if (message.textClassificationConfig != null && message.hasOwnProperty("textClassificationConfig")) { + object.textClassificationConfig = $root.google.cloud.datalabeling.v1beta1.TextClassificationConfig.toObject(message.textClassificationConfig, options); + if (options.oneofs) + object.humanAnnotationRequestConfig = "textClassificationConfig"; + } + var keys2; + if (message.bigqueryImportKeys && (keys2 = Object.keys(message.bigqueryImportKeys)).length) { + object.bigqueryImportKeys = {}; + for (var j = 0; j < keys2.length; ++j) + object.bigqueryImportKeys[keys2[j]] = message.bigqueryImportKeys[keys2[j]]; + } + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + if (message.exampleSamplePercentage != null && message.hasOwnProperty("exampleSamplePercentage")) + object.exampleSamplePercentage = options.json && !isFinite(message.exampleSamplePercentage) ? String(message.exampleSamplePercentage) : message.exampleSamplePercentage; + if (message.evaluationJobAlertConfig != null && message.hasOwnProperty("evaluationJobAlertConfig")) + object.evaluationJobAlertConfig = $root.google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig.toObject(message.evaluationJobAlertConfig, options); + return object; + }; + + /** + * Converts this EvaluationJobConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @instance + * @returns {Object.} JSON object + */ + EvaluationJobConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationJobConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationJobConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.EvaluationJobConfig"; + }; + + return EvaluationJobConfig; + })(); + + v1beta1.EvaluationJobAlertConfig = (function() { + + /** + * Properties of an EvaluationJobAlertConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IEvaluationJobAlertConfig + * @property {string|null} [email] EvaluationJobAlertConfig email + * @property {number|null} [minAcceptableMeanAveragePrecision] EvaluationJobAlertConfig minAcceptableMeanAveragePrecision + */ + + /** + * Constructs a new EvaluationJobAlertConfig. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an EvaluationJobAlertConfig. + * @implements IEvaluationJobAlertConfig + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig=} [properties] Properties to set + */ + function EvaluationJobAlertConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationJobAlertConfig email. + * @member {string} email + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @instance + */ + EvaluationJobAlertConfig.prototype.email = ""; + + /** + * EvaluationJobAlertConfig minAcceptableMeanAveragePrecision. + * @member {number} minAcceptableMeanAveragePrecision + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @instance + */ + EvaluationJobAlertConfig.prototype.minAcceptableMeanAveragePrecision = 0; + + /** + * Creates a new EvaluationJobAlertConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig} EvaluationJobAlertConfig instance + */ + EvaluationJobAlertConfig.create = function create(properties) { + return new EvaluationJobAlertConfig(properties); + }; + + /** + * Encodes the specified EvaluationJobAlertConfig message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig} message EvaluationJobAlertConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationJobAlertConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + if (message.minAcceptableMeanAveragePrecision != null && Object.hasOwnProperty.call(message, "minAcceptableMeanAveragePrecision")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.minAcceptableMeanAveragePrecision); + return writer; + }; + + /** + * Encodes the specified EvaluationJobAlertConfig message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.IEvaluationJobAlertConfig} message EvaluationJobAlertConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationJobAlertConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationJobAlertConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig} EvaluationJobAlertConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationJobAlertConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + case 2: { + message.minAcceptableMeanAveragePrecision = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationJobAlertConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig} EvaluationJobAlertConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationJobAlertConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationJobAlertConfig message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationJobAlertConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.minAcceptableMeanAveragePrecision != null && message.hasOwnProperty("minAcceptableMeanAveragePrecision")) + if (typeof message.minAcceptableMeanAveragePrecision !== "number") + return "minAcceptableMeanAveragePrecision: number expected"; + return null; + }; + + /** + * Creates an EvaluationJobAlertConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig} EvaluationJobAlertConfig + */ + EvaluationJobAlertConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig(); + if (object.email != null) + message.email = String(object.email); + if (object.minAcceptableMeanAveragePrecision != null) + message.minAcceptableMeanAveragePrecision = Number(object.minAcceptableMeanAveragePrecision); + return message; + }; + + /** + * Creates a plain object from an EvaluationJobAlertConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @static + * @param {google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig} message EvaluationJobAlertConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationJobAlertConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.email = ""; + object.minAcceptableMeanAveragePrecision = 0; + } + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.minAcceptableMeanAveragePrecision != null && message.hasOwnProperty("minAcceptableMeanAveragePrecision")) + object.minAcceptableMeanAveragePrecision = options.json && !isFinite(message.minAcceptableMeanAveragePrecision) ? String(message.minAcceptableMeanAveragePrecision) : message.minAcceptableMeanAveragePrecision; + return object; + }; + + /** + * Converts this EvaluationJobAlertConfig to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @instance + * @returns {Object.} JSON object + */ + EvaluationJobAlertConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationJobAlertConfig + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationJobAlertConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig"; + }; + + return EvaluationJobAlertConfig; + })(); + + v1beta1.Attempt = (function() { + + /** + * Properties of an Attempt. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IAttempt + * @property {google.protobuf.ITimestamp|null} [attemptTime] Attempt attemptTime + * @property {Array.|null} [partialFailures] Attempt partialFailures + */ + + /** + * Constructs a new Attempt. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an Attempt. + * @implements IAttempt + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IAttempt=} [properties] Properties to set + */ + function Attempt(properties) { + this.partialFailures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Attempt attemptTime. + * @member {google.protobuf.ITimestamp|null|undefined} attemptTime + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @instance + */ + Attempt.prototype.attemptTime = null; + + /** + * Attempt partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @instance + */ + Attempt.prototype.partialFailures = $util.emptyArray; + + /** + * Creates a new Attempt instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @static + * @param {google.cloud.datalabeling.v1beta1.IAttempt=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.Attempt} Attempt instance + */ + Attempt.create = function create(properties) { + return new Attempt(properties); + }; + + /** + * Encodes the specified Attempt message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Attempt.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @static + * @param {google.cloud.datalabeling.v1beta1.IAttempt} message Attempt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attempt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attemptTime != null && Object.hasOwnProperty.call(message, "attemptTime")) + $root.google.protobuf.Timestamp.encode(message.attemptTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.partialFailures != null && message.partialFailures.length) + for (var i = 0; i < message.partialFailures.length; ++i) + $root.google.rpc.Status.encode(message.partialFailures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Attempt message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Attempt.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @static + * @param {google.cloud.datalabeling.v1beta1.IAttempt} message Attempt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attempt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attempt message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.Attempt} Attempt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attempt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.Attempt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attemptTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.partialFailures && message.partialFailures.length)) + message.partialFailures = []; + message.partialFailures.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attempt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.Attempt} Attempt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attempt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attempt message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attempt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attemptTime != null && message.hasOwnProperty("attemptTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.attemptTime); + if (error) + return "attemptTime." + error; + } + if (message.partialFailures != null && message.hasOwnProperty("partialFailures")) { + if (!Array.isArray(message.partialFailures)) + return "partialFailures: array expected"; + for (var i = 0; i < message.partialFailures.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialFailures[i]); + if (error) + return "partialFailures." + error; + } + } + return null; + }; + + /** + * Creates an Attempt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.Attempt} Attempt + */ + Attempt.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.Attempt) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.Attempt(); + if (object.attemptTime != null) { + if (typeof object.attemptTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Attempt.attemptTime: object expected"); + message.attemptTime = $root.google.protobuf.Timestamp.fromObject(object.attemptTime); + } + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.datalabeling.v1beta1.Attempt.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Attempt.partialFailures: object expected"); + message.partialFailures[i] = $root.google.rpc.Status.fromObject(object.partialFailures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Attempt message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @static + * @param {google.cloud.datalabeling.v1beta1.Attempt} message Attempt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attempt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) + object.attemptTime = null; + if (message.attemptTime != null && message.hasOwnProperty("attemptTime")) + object.attemptTime = $root.google.protobuf.Timestamp.toObject(message.attemptTime, options); + if (message.partialFailures && message.partialFailures.length) { + object.partialFailures = []; + for (var j = 0; j < message.partialFailures.length; ++j) + object.partialFailures[j] = $root.google.rpc.Status.toObject(message.partialFailures[j], options); + } + return object; + }; + + /** + * Converts this Attempt to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @instance + * @returns {Object.} JSON object + */ + Attempt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Attempt + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.Attempt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attempt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.Attempt"; + }; + + return Attempt; + })(); + + v1beta1.Instruction = (function() { + + /** + * Properties of an Instruction. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IInstruction + * @property {string|null} [name] Instruction name + * @property {string|null} [displayName] Instruction displayName + * @property {string|null} [description] Instruction description + * @property {google.protobuf.ITimestamp|null} [createTime] Instruction createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instruction updateTime + * @property {google.cloud.datalabeling.v1beta1.DataType|null} [dataType] Instruction dataType + * @property {google.cloud.datalabeling.v1beta1.ICsvInstruction|null} [csvInstruction] Instruction csvInstruction + * @property {google.cloud.datalabeling.v1beta1.IPdfInstruction|null} [pdfInstruction] Instruction pdfInstruction + * @property {Array.|null} [blockingResources] Instruction blockingResources + */ + + /** + * Constructs a new Instruction. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an Instruction. + * @implements IInstruction + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IInstruction=} [properties] Properties to set + */ + function Instruction(properties) { + this.blockingResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instruction name. + * @member {string} name + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + */ + Instruction.prototype.name = ""; + + /** + * Instruction displayName. + * @member {string} displayName + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + */ + Instruction.prototype.displayName = ""; + + /** + * Instruction description. + * @member {string} description + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + */ + Instruction.prototype.description = ""; + + /** + * Instruction createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + */ + Instruction.prototype.createTime = null; + + /** + * Instruction updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + */ + Instruction.prototype.updateTime = null; + + /** + * Instruction dataType. + * @member {google.cloud.datalabeling.v1beta1.DataType} dataType + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + */ + Instruction.prototype.dataType = 0; + + /** + * Instruction csvInstruction. + * @member {google.cloud.datalabeling.v1beta1.ICsvInstruction|null|undefined} csvInstruction + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + */ + Instruction.prototype.csvInstruction = null; + + /** + * Instruction pdfInstruction. + * @member {google.cloud.datalabeling.v1beta1.IPdfInstruction|null|undefined} pdfInstruction + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + */ + Instruction.prototype.pdfInstruction = null; + + /** + * Instruction blockingResources. + * @member {Array.} blockingResources + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + */ + Instruction.prototype.blockingResources = $util.emptyArray; + + /** + * Creates a new Instruction instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @static + * @param {google.cloud.datalabeling.v1beta1.IInstruction=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.Instruction} Instruction instance + */ + Instruction.create = function create(properties) { + return new Instruction(properties); + }; + + /** + * Encodes the specified Instruction message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Instruction.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @static + * @param {google.cloud.datalabeling.v1beta1.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.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); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.dataType); + if (message.csvInstruction != null && Object.hasOwnProperty.call(message, "csvInstruction")) + $root.google.cloud.datalabeling.v1beta1.CsvInstruction.encode(message.csvInstruction, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pdfInstruction != null && Object.hasOwnProperty.call(message, "pdfInstruction")) + $root.google.cloud.datalabeling.v1beta1.PdfInstruction.encode(message.pdfInstruction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.blockingResources != null && message.blockingResources.length) + for (var i = 0; i < message.blockingResources.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.blockingResources[i]); + return writer; + }; + + /** + * Encodes the specified Instruction message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.Instruction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @static + * @param {google.cloud.datalabeling.v1beta1.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instruction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.Instruction(); + 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; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.dataType = reader.int32(); + break; + } + case 7: { + message.csvInstruction = $root.google.cloud.datalabeling.v1beta1.CsvInstruction.decode(reader, reader.uint32()); + break; + } + case 9: { + message.pdfInstruction = $root.google.cloud.datalabeling.v1beta1.PdfInstruction.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.blockingResources && message.blockingResources.length)) + message.blockingResources = []; + message.blockingResources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instruction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instruction message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instruction.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"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 6: + break; + } + if (message.csvInstruction != null && message.hasOwnProperty("csvInstruction")) { + var error = $root.google.cloud.datalabeling.v1beta1.CsvInstruction.verify(message.csvInstruction); + if (error) + return "csvInstruction." + error; + } + if (message.pdfInstruction != null && message.hasOwnProperty("pdfInstruction")) { + var error = $root.google.cloud.datalabeling.v1beta1.PdfInstruction.verify(message.pdfInstruction); + if (error) + return "pdfInstruction." + error; + } + if (message.blockingResources != null && message.hasOwnProperty("blockingResources")) { + if (!Array.isArray(message.blockingResources)) + return "blockingResources: array expected"; + for (var i = 0; i < message.blockingResources.length; ++i) + if (!$util.isString(message.blockingResources[i])) + return "blockingResources: string[] expected"; + } + return null; + }; + + /** + * Creates an Instruction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.Instruction} Instruction + */ + Instruction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.Instruction) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.Instruction(); + 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); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Instruction.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Instruction.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "IMAGE": + case 1: + message.dataType = 1; + break; + case "VIDEO": + case 2: + message.dataType = 2; + break; + case "TEXT": + case 4: + message.dataType = 4; + break; + case "GENERAL_DATA": + case 6: + message.dataType = 6; + break; + } + if (object.csvInstruction != null) { + if (typeof object.csvInstruction !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Instruction.csvInstruction: object expected"); + message.csvInstruction = $root.google.cloud.datalabeling.v1beta1.CsvInstruction.fromObject(object.csvInstruction); + } + if (object.pdfInstruction != null) { + if (typeof object.pdfInstruction !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.Instruction.pdfInstruction: object expected"); + message.pdfInstruction = $root.google.cloud.datalabeling.v1beta1.PdfInstruction.fromObject(object.pdfInstruction); + } + if (object.blockingResources) { + if (!Array.isArray(object.blockingResources)) + throw TypeError(".google.cloud.datalabeling.v1beta1.Instruction.blockingResources: array expected"); + message.blockingResources = []; + for (var i = 0; i < object.blockingResources.length; ++i) + message.blockingResources[i] = String(object.blockingResources[i]); + } + return message; + }; + + /** + * Creates a plain object from an Instruction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @static + * @param {google.cloud.datalabeling.v1beta1.Instruction} message Instruction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instruction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blockingResources = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.csvInstruction = null; + object.pdfInstruction = null; + } + 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; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.datalabeling.v1beta1.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.datalabeling.v1beta1.DataType[message.dataType] : message.dataType; + if (message.csvInstruction != null && message.hasOwnProperty("csvInstruction")) + object.csvInstruction = $root.google.cloud.datalabeling.v1beta1.CsvInstruction.toObject(message.csvInstruction, options); + if (message.pdfInstruction != null && message.hasOwnProperty("pdfInstruction")) + object.pdfInstruction = $root.google.cloud.datalabeling.v1beta1.PdfInstruction.toObject(message.pdfInstruction, options); + if (message.blockingResources && message.blockingResources.length) { + object.blockingResources = []; + for (var j = 0; j < message.blockingResources.length; ++j) + object.blockingResources[j] = message.blockingResources[j]; + } + return object; + }; + + /** + * Converts this Instruction to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @instance + * @returns {Object.} JSON object + */ + Instruction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instruction + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.Instruction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.Instruction"; + }; + + return Instruction; + })(); + + v1beta1.CsvInstruction = (function() { + + /** + * Properties of a CsvInstruction. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ICsvInstruction + * @property {string|null} [gcsFileUri] CsvInstruction gcsFileUri + */ + + /** + * Constructs a new CsvInstruction. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a CsvInstruction. + * @implements ICsvInstruction + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ICsvInstruction=} [properties] Properties to set + */ + function CsvInstruction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CsvInstruction gcsFileUri. + * @member {string} gcsFileUri + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @instance + */ + CsvInstruction.prototype.gcsFileUri = ""; + + /** + * Creates a new CsvInstruction instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @static + * @param {google.cloud.datalabeling.v1beta1.ICsvInstruction=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.CsvInstruction} CsvInstruction instance + */ + CsvInstruction.create = function create(properties) { + return new CsvInstruction(properties); + }; + + /** + * Encodes the specified CsvInstruction message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CsvInstruction.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @static + * @param {google.cloud.datalabeling.v1beta1.ICsvInstruction} message CsvInstruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvInstruction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsFileUri != null && Object.hasOwnProperty.call(message, "gcsFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsFileUri); + return writer; + }; + + /** + * Encodes the specified CsvInstruction message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CsvInstruction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @static + * @param {google.cloud.datalabeling.v1beta1.ICsvInstruction} message CsvInstruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvInstruction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvInstruction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.CsvInstruction} CsvInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvInstruction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.CsvInstruction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsFileUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvInstruction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.CsvInstruction} CsvInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvInstruction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvInstruction message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvInstruction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsFileUri != null && message.hasOwnProperty("gcsFileUri")) + if (!$util.isString(message.gcsFileUri)) + return "gcsFileUri: string expected"; + return null; + }; + + /** + * Creates a CsvInstruction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.CsvInstruction} CsvInstruction + */ + CsvInstruction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.CsvInstruction) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.CsvInstruction(); + if (object.gcsFileUri != null) + message.gcsFileUri = String(object.gcsFileUri); + return message; + }; + + /** + * Creates a plain object from a CsvInstruction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @static + * @param {google.cloud.datalabeling.v1beta1.CsvInstruction} message CsvInstruction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvInstruction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsFileUri = ""; + if (message.gcsFileUri != null && message.hasOwnProperty("gcsFileUri")) + object.gcsFileUri = message.gcsFileUri; + return object; + }; + + /** + * Converts this CsvInstruction to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @instance + * @returns {Object.} JSON object + */ + CsvInstruction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvInstruction + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.CsvInstruction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvInstruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.CsvInstruction"; + }; + + return CsvInstruction; + })(); + + v1beta1.PdfInstruction = (function() { + + /** + * Properties of a PdfInstruction. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IPdfInstruction + * @property {string|null} [gcsFileUri] PdfInstruction gcsFileUri + */ + + /** + * Constructs a new PdfInstruction. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a PdfInstruction. + * @implements IPdfInstruction + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IPdfInstruction=} [properties] Properties to set + */ + function PdfInstruction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PdfInstruction gcsFileUri. + * @member {string} gcsFileUri + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @instance + */ + PdfInstruction.prototype.gcsFileUri = ""; + + /** + * Creates a new PdfInstruction instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @static + * @param {google.cloud.datalabeling.v1beta1.IPdfInstruction=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.PdfInstruction} PdfInstruction instance + */ + PdfInstruction.create = function create(properties) { + return new PdfInstruction(properties); + }; + + /** + * Encodes the specified PdfInstruction message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PdfInstruction.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @static + * @param {google.cloud.datalabeling.v1beta1.IPdfInstruction} message PdfInstruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PdfInstruction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsFileUri != null && Object.hasOwnProperty.call(message, "gcsFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsFileUri); + return writer; + }; + + /** + * Encodes the specified PdfInstruction message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.PdfInstruction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @static + * @param {google.cloud.datalabeling.v1beta1.IPdfInstruction} message PdfInstruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PdfInstruction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PdfInstruction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.PdfInstruction} PdfInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PdfInstruction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.PdfInstruction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsFileUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PdfInstruction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.PdfInstruction} PdfInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PdfInstruction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PdfInstruction message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PdfInstruction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsFileUri != null && message.hasOwnProperty("gcsFileUri")) + if (!$util.isString(message.gcsFileUri)) + return "gcsFileUri: string expected"; + return null; + }; + + /** + * Creates a PdfInstruction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.PdfInstruction} PdfInstruction + */ + PdfInstruction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.PdfInstruction) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.PdfInstruction(); + if (object.gcsFileUri != null) + message.gcsFileUri = String(object.gcsFileUri); + return message; + }; + + /** + * Creates a plain object from a PdfInstruction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @static + * @param {google.cloud.datalabeling.v1beta1.PdfInstruction} message PdfInstruction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PdfInstruction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsFileUri = ""; + if (message.gcsFileUri != null && message.hasOwnProperty("gcsFileUri")) + object.gcsFileUri = message.gcsFileUri; + return object; + }; + + /** + * Converts this PdfInstruction to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @instance + * @returns {Object.} JSON object + */ + PdfInstruction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PdfInstruction + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.PdfInstruction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PdfInstruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.PdfInstruction"; + }; + + return PdfInstruction; + })(); + + v1beta1.ImportDataOperationResponse = (function() { + + /** + * Properties of an ImportDataOperationResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IImportDataOperationResponse + * @property {string|null} [dataset] ImportDataOperationResponse dataset + * @property {number|null} [totalCount] ImportDataOperationResponse totalCount + * @property {number|null} [importCount] ImportDataOperationResponse importCount + */ + + /** + * Constructs a new ImportDataOperationResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ImportDataOperationResponse. + * @implements IImportDataOperationResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IImportDataOperationResponse=} [properties] Properties to set + */ + function ImportDataOperationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDataOperationResponse dataset. + * @member {string} dataset + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @instance + */ + ImportDataOperationResponse.prototype.dataset = ""; + + /** + * ImportDataOperationResponse totalCount. + * @member {number} totalCount + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @instance + */ + ImportDataOperationResponse.prototype.totalCount = 0; + + /** + * ImportDataOperationResponse importCount. + * @member {number} importCount + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @instance + */ + ImportDataOperationResponse.prototype.importCount = 0; + + /** + * Creates a new ImportDataOperationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IImportDataOperationResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ImportDataOperationResponse} ImportDataOperationResponse instance + */ + ImportDataOperationResponse.create = function create(properties) { + return new ImportDataOperationResponse(properties); + }; + + /** + * Encodes the specified ImportDataOperationResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IImportDataOperationResponse} message ImportDataOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalCount); + if (message.importCount != null && Object.hasOwnProperty.call(message, "importCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.importCount); + return writer; + }; + + /** + * Encodes the specified ImportDataOperationResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IImportDataOperationResponse} message ImportDataOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ImportDataOperationResponse} ImportDataOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataOperationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.totalCount = reader.int32(); + break; + } + case 3: { + message.importCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ImportDataOperationResponse} ImportDataOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataOperationResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (!$util.isInteger(message.totalCount)) + return "totalCount: integer expected"; + if (message.importCount != null && message.hasOwnProperty("importCount")) + if (!$util.isInteger(message.importCount)) + return "importCount: integer expected"; + return null; + }; + + /** + * Creates an ImportDataOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ImportDataOperationResponse} ImportDataOperationResponse + */ + ImportDataOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.totalCount != null) + message.totalCount = object.totalCount | 0; + if (object.importCount != null) + message.importCount = object.importCount | 0; + return message; + }; + + /** + * Creates a plain object from an ImportDataOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ImportDataOperationResponse} message ImportDataOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataOperationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.totalCount = 0; + object.importCount = 0; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + object.totalCount = message.totalCount; + if (message.importCount != null && message.hasOwnProperty("importCount")) + object.importCount = message.importCount; + return object; + }; + + /** + * Converts this ImportDataOperationResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @instance + * @returns {Object.} JSON object + */ + ImportDataOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataOperationResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataOperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ImportDataOperationResponse"; + }; + + return ImportDataOperationResponse; + })(); + + v1beta1.ExportDataOperationResponse = (function() { + + /** + * Properties of an ExportDataOperationResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IExportDataOperationResponse + * @property {string|null} [dataset] ExportDataOperationResponse dataset + * @property {number|null} [totalCount] ExportDataOperationResponse totalCount + * @property {number|null} [exportCount] ExportDataOperationResponse exportCount + * @property {google.cloud.datalabeling.v1beta1.ILabelStats|null} [labelStats] ExportDataOperationResponse labelStats + * @property {google.cloud.datalabeling.v1beta1.IOutputConfig|null} [outputConfig] ExportDataOperationResponse outputConfig + */ + + /** + * Constructs a new ExportDataOperationResponse. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ExportDataOperationResponse. + * @implements IExportDataOperationResponse + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IExportDataOperationResponse=} [properties] Properties to set + */ + function ExportDataOperationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataOperationResponse dataset. + * @member {string} dataset + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @instance + */ + ExportDataOperationResponse.prototype.dataset = ""; + + /** + * ExportDataOperationResponse totalCount. + * @member {number} totalCount + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @instance + */ + ExportDataOperationResponse.prototype.totalCount = 0; + + /** + * ExportDataOperationResponse exportCount. + * @member {number} exportCount + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @instance + */ + ExportDataOperationResponse.prototype.exportCount = 0; + + /** + * ExportDataOperationResponse labelStats. + * @member {google.cloud.datalabeling.v1beta1.ILabelStats|null|undefined} labelStats + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @instance + */ + ExportDataOperationResponse.prototype.labelStats = null; + + /** + * ExportDataOperationResponse outputConfig. + * @member {google.cloud.datalabeling.v1beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @instance + */ + ExportDataOperationResponse.prototype.outputConfig = null; + + /** + * Creates a new ExportDataOperationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IExportDataOperationResponse=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ExportDataOperationResponse} ExportDataOperationResponse instance + */ + ExportDataOperationResponse.create = function create(properties) { + return new ExportDataOperationResponse(properties); + }; + + /** + * Encodes the specified ExportDataOperationResponse message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IExportDataOperationResponse} message ExportDataOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalCount); + if (message.exportCount != null && Object.hasOwnProperty.call(message, "exportCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.exportCount); + if (message.labelStats != null && Object.hasOwnProperty.call(message, "labelStats")) + $root.google.cloud.datalabeling.v1beta1.LabelStats.encode(message.labelStats, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.datalabeling.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataOperationResponse message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.IExportDataOperationResponse} message ExportDataOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ExportDataOperationResponse} ExportDataOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOperationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.totalCount = reader.int32(); + break; + } + case 3: { + message.exportCount = reader.int32(); + break; + } + case 4: { + message.labelStats = $root.google.cloud.datalabeling.v1beta1.LabelStats.decode(reader, reader.uint32()); + break; + } + case 5: { + message.outputConfig = $root.google.cloud.datalabeling.v1beta1.OutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ExportDataOperationResponse} ExportDataOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataOperationResponse message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (!$util.isInteger(message.totalCount)) + return "totalCount: integer expected"; + if (message.exportCount != null && message.hasOwnProperty("exportCount")) + if (!$util.isInteger(message.exportCount)) + return "exportCount: integer expected"; + if (message.labelStats != null && message.hasOwnProperty("labelStats")) { + var error = $root.google.cloud.datalabeling.v1beta1.LabelStats.verify(message.labelStats); + if (error) + return "labelStats." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportDataOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ExportDataOperationResponse} ExportDataOperationResponse + */ + ExportDataOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.totalCount != null) + message.totalCount = object.totalCount | 0; + if (object.exportCount != null) + message.exportCount = object.exportCount | 0; + if (object.labelStats != null) { + if (typeof object.labelStats !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.labelStats: object expected"); + message.labelStats = $root.google.cloud.datalabeling.v1beta1.LabelStats.fromObject(object.labelStats); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.datalabeling.v1beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @static + * @param {google.cloud.datalabeling.v1beta1.ExportDataOperationResponse} message ExportDataOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataOperationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.totalCount = 0; + object.exportCount = 0; + object.labelStats = null; + object.outputConfig = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + object.totalCount = message.totalCount; + if (message.exportCount != null && message.hasOwnProperty("exportCount")) + object.exportCount = message.exportCount; + if (message.labelStats != null && message.hasOwnProperty("labelStats")) + object.labelStats = $root.google.cloud.datalabeling.v1beta1.LabelStats.toObject(message.labelStats, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.datalabeling.v1beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportDataOperationResponse to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @instance + * @returns {Object.} JSON object + */ + ExportDataOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataOperationResponse + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataOperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ExportDataOperationResponse"; + }; + + return ExportDataOperationResponse; + })(); + + v1beta1.ImportDataOperationMetadata = (function() { + + /** + * Properties of an ImportDataOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IImportDataOperationMetadata + * @property {string|null} [dataset] ImportDataOperationMetadata dataset + * @property {Array.|null} [partialFailures] ImportDataOperationMetadata partialFailures + * @property {google.protobuf.ITimestamp|null} [createTime] ImportDataOperationMetadata createTime + */ + + /** + * Constructs a new ImportDataOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ImportDataOperationMetadata. + * @implements IImportDataOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata=} [properties] Properties to set + */ + function ImportDataOperationMetadata(properties) { + this.partialFailures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDataOperationMetadata dataset. + * @member {string} dataset + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @instance + */ + ImportDataOperationMetadata.prototype.dataset = ""; + + /** + * ImportDataOperationMetadata partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @instance + */ + ImportDataOperationMetadata.prototype.partialFailures = $util.emptyArray; + + /** + * ImportDataOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @instance + */ + ImportDataOperationMetadata.prototype.createTime = null; + + /** + * Creates a new ImportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata instance + */ + ImportDataOperationMetadata.create = function create(properties) { + return new ImportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata} message ImportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.partialFailures != null && message.partialFailures.length) + for (var i = 0; i < message.partialFailures.length; ++i) + $root.google.rpc.Status.encode(message.partialFailures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata} message ImportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + if (!(message.partialFailures && message.partialFailures.length)) + message.partialFailures = []; + message.partialFailures.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.partialFailures != null && message.hasOwnProperty("partialFailures")) { + if (!Array.isArray(message.partialFailures)) + return "partialFailures: array expected"; + for (var i = 0; i < message.partialFailures.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialFailures[i]); + if (error) + return "partialFailures." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates an ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata + */ + ImportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.partialFailures: object expected"); + message.partialFailures[i] = $root.google.rpc.Status.fromObject(object.partialFailures[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata} message ImportDataOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) { + object.dataset = ""; + object.createTime = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.partialFailures && message.partialFailures.length) { + object.partialFailures = []; + for (var j = 0; j < message.partialFailures.length; ++j) + object.partialFailures[j] = $root.google.rpc.Status.toObject(message.partialFailures[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this ImportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportDataOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata"; + }; + + return ImportDataOperationMetadata; + })(); + + v1beta1.ExportDataOperationMetadata = (function() { + + /** + * Properties of an ExportDataOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface IExportDataOperationMetadata + * @property {string|null} [dataset] ExportDataOperationMetadata dataset + * @property {Array.|null} [partialFailures] ExportDataOperationMetadata partialFailures + * @property {google.protobuf.ITimestamp|null} [createTime] ExportDataOperationMetadata createTime + */ + + /** + * Constructs a new ExportDataOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents an ExportDataOperationMetadata. + * @implements IExportDataOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata=} [properties] Properties to set + */ + function ExportDataOperationMetadata(properties) { + this.partialFailures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataOperationMetadata dataset. + * @member {string} dataset + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @instance + */ + ExportDataOperationMetadata.prototype.dataset = ""; + + /** + * ExportDataOperationMetadata partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @instance + */ + ExportDataOperationMetadata.prototype.partialFailures = $util.emptyArray; + + /** + * ExportDataOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @instance + */ + ExportDataOperationMetadata.prototype.createTime = null; + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata instance + */ + ExportDataOperationMetadata.create = function create(properties) { + return new ExportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata} message ExportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.partialFailures != null && message.partialFailures.length) + for (var i = 0; i < message.partialFailures.length; ++i) + $root.google.rpc.Status.encode(message.partialFailures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata} message ExportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + if (!(message.partialFailures && message.partialFailures.length)) + message.partialFailures = []; + message.partialFailures.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.partialFailures != null && message.hasOwnProperty("partialFailures")) { + if (!Array.isArray(message.partialFailures)) + return "partialFailures: array expected"; + for (var i = 0; i < message.partialFailures.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialFailures[i]); + if (error) + return "partialFailures." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates an ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata + */ + ExportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.partialFailures: object expected"); + message.partialFailures[i] = $root.google.rpc.Status.fromObject(object.partialFailures[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata} message ExportDataOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) { + object.dataset = ""; + object.createTime = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.partialFailures && message.partialFailures.length) { + object.partialFailures = []; + for (var j = 0; j < message.partialFailures.length; ++j) + object.partialFailures[j] = $root.google.rpc.Status.toObject(message.partialFailures[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this ExportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportDataOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata"; + }; + + return ExportDataOperationMetadata; + })(); + + v1beta1.LabelOperationMetadata = (function() { + + /** + * Properties of a LabelOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata|null} [imageClassificationDetails] LabelOperationMetadata imageClassificationDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata|null} [imageBoundingBoxDetails] LabelOperationMetadata imageBoundingBoxDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata|null} [imageBoundingPolyDetails] LabelOperationMetadata imageBoundingPolyDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata|null} [imageOrientedBoundingBoxDetails] LabelOperationMetadata imageOrientedBoundingBoxDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata|null} [imagePolylineDetails] LabelOperationMetadata imagePolylineDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata|null} [imageSegmentationDetails] LabelOperationMetadata imageSegmentationDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata|null} [videoClassificationDetails] LabelOperationMetadata videoClassificationDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata|null} [videoObjectDetectionDetails] LabelOperationMetadata videoObjectDetectionDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata|null} [videoObjectTrackingDetails] LabelOperationMetadata videoObjectTrackingDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata|null} [videoEventDetails] LabelOperationMetadata videoEventDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata|null} [textClassificationDetails] LabelOperationMetadata textClassificationDetails + * @property {google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata|null} [textEntityExtractionDetails] LabelOperationMetadata textEntityExtractionDetails + * @property {number|null} [progressPercent] LabelOperationMetadata progressPercent + * @property {Array.|null} [partialFailures] LabelOperationMetadata partialFailures + * @property {google.protobuf.ITimestamp|null} [createTime] LabelOperationMetadata createTime + */ + + /** + * Constructs a new LabelOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelOperationMetadata. + * @implements ILabelOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelOperationMetadata=} [properties] Properties to set + */ + function LabelOperationMetadata(properties) { + this.partialFailures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelOperationMetadata imageClassificationDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata|null|undefined} imageClassificationDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.imageClassificationDetails = null; + + /** + * LabelOperationMetadata imageBoundingBoxDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata|null|undefined} imageBoundingBoxDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.imageBoundingBoxDetails = null; + + /** + * LabelOperationMetadata imageBoundingPolyDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata|null|undefined} imageBoundingPolyDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.imageBoundingPolyDetails = null; + + /** + * LabelOperationMetadata imageOrientedBoundingBoxDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata|null|undefined} imageOrientedBoundingBoxDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.imageOrientedBoundingBoxDetails = null; + + /** + * LabelOperationMetadata imagePolylineDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata|null|undefined} imagePolylineDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.imagePolylineDetails = null; + + /** + * LabelOperationMetadata imageSegmentationDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata|null|undefined} imageSegmentationDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.imageSegmentationDetails = null; + + /** + * LabelOperationMetadata videoClassificationDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata|null|undefined} videoClassificationDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.videoClassificationDetails = null; + + /** + * LabelOperationMetadata videoObjectDetectionDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata|null|undefined} videoObjectDetectionDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.videoObjectDetectionDetails = null; + + /** + * LabelOperationMetadata videoObjectTrackingDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata|null|undefined} videoObjectTrackingDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.videoObjectTrackingDetails = null; + + /** + * LabelOperationMetadata videoEventDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata|null|undefined} videoEventDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.videoEventDetails = null; + + /** + * LabelOperationMetadata textClassificationDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata|null|undefined} textClassificationDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.textClassificationDetails = null; + + /** + * LabelOperationMetadata textEntityExtractionDetails. + * @member {google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata|null|undefined} textEntityExtractionDetails + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.textEntityExtractionDetails = null; + + /** + * LabelOperationMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.progressPercent = 0; + + /** + * LabelOperationMetadata partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.partialFailures = $util.emptyArray; + + /** + * LabelOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + LabelOperationMetadata.prototype.createTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LabelOperationMetadata details. + * @member {"imageClassificationDetails"|"imageBoundingBoxDetails"|"imageBoundingPolyDetails"|"imageOrientedBoundingBoxDetails"|"imagePolylineDetails"|"imageSegmentationDetails"|"videoClassificationDetails"|"videoObjectDetectionDetails"|"videoObjectTrackingDetails"|"videoEventDetails"|"textClassificationDetails"|"textEntityExtractionDetails"|undefined} details + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + */ + Object.defineProperty(LabelOperationMetadata.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["imageClassificationDetails", "imageBoundingBoxDetails", "imageBoundingPolyDetails", "imageOrientedBoundingBoxDetails", "imagePolylineDetails", "imageSegmentationDetails", "videoClassificationDetails", "videoObjectDetectionDetails", "videoObjectTrackingDetails", "videoEventDetails", "textClassificationDetails", "textEntityExtractionDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LabelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelOperationMetadata} LabelOperationMetadata instance + */ + LabelOperationMetadata.create = function create(properties) { + return new LabelOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelOperationMetadata} message LabelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); + if (message.partialFailures != null && message.partialFailures.length) + for (var i = 0; i < message.partialFailures.length; ++i) + $root.google.rpc.Status.encode(message.partialFailures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageClassificationDetails != null && Object.hasOwnProperty.call(message, "imageClassificationDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.encode(message.imageClassificationDetails, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.imageBoundingBoxDetails != null && Object.hasOwnProperty.call(message, "imageBoundingBoxDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.encode(message.imageBoundingBoxDetails, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.videoClassificationDetails != null && Object.hasOwnProperty.call(message, "videoClassificationDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.encode(message.videoClassificationDetails, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.videoObjectDetectionDetails != null && Object.hasOwnProperty.call(message, "videoObjectDetectionDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.encode(message.videoObjectDetectionDetails, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.videoObjectTrackingDetails != null && Object.hasOwnProperty.call(message, "videoObjectTrackingDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.encode(message.videoObjectTrackingDetails, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.videoEventDetails != null && Object.hasOwnProperty.call(message, "videoEventDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.encode(message.videoEventDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.textClassificationDetails != null && Object.hasOwnProperty.call(message, "textClassificationDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.encode(message.textClassificationDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.imageBoundingPolyDetails != null && Object.hasOwnProperty.call(message, "imageBoundingPolyDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.encode(message.imageBoundingPolyDetails, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imagePolylineDetails != null && Object.hasOwnProperty.call(message, "imagePolylineDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.encode(message.imagePolylineDetails, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.textEntityExtractionDetails != null && Object.hasOwnProperty.call(message, "textEntityExtractionDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.encode(message.textEntityExtractionDetails, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.imageOrientedBoundingBoxDetails != null && Object.hasOwnProperty.call(message, "imageOrientedBoundingBoxDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.encode(message.imageOrientedBoundingBoxDetails, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.imageSegmentationDetails != null && Object.hasOwnProperty.call(message, "imageSegmentationDetails")) + $root.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.encode(message.imageSegmentationDetails, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelOperationMetadata} message LabelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelOperationMetadata} LabelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.imageClassificationDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.imageBoundingBoxDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 11: { + message.imageBoundingPolyDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 14: { + message.imageOrientedBoundingBoxDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 12: { + message.imagePolylineDetails = $root.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 15: { + message.imageSegmentationDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 5: { + message.videoClassificationDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 6: { + message.videoObjectDetectionDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 7: { + message.videoObjectTrackingDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 8: { + message.videoEventDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 9: { + message.textClassificationDetails = $root.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.textEntityExtractionDetails = $root.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + if (!(message.partialFailures && message.partialFailures.length)) + message.partialFailures = []; + message.partialFailures.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 16: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelOperationMetadata} LabelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageClassificationDetails != null && message.hasOwnProperty("imageClassificationDetails")) { + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.verify(message.imageClassificationDetails); + if (error) + return "imageClassificationDetails." + error; + } + } + if (message.imageBoundingBoxDetails != null && message.hasOwnProperty("imageBoundingBoxDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.verify(message.imageBoundingBoxDetails); + if (error) + return "imageBoundingBoxDetails." + error; + } + } + if (message.imageBoundingPolyDetails != null && message.hasOwnProperty("imageBoundingPolyDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.verify(message.imageBoundingPolyDetails); + if (error) + return "imageBoundingPolyDetails." + error; + } + } + if (message.imageOrientedBoundingBoxDetails != null && message.hasOwnProperty("imageOrientedBoundingBoxDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.verify(message.imageOrientedBoundingBoxDetails); + if (error) + return "imageOrientedBoundingBoxDetails." + error; + } + } + if (message.imagePolylineDetails != null && message.hasOwnProperty("imagePolylineDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.verify(message.imagePolylineDetails); + if (error) + return "imagePolylineDetails." + error; + } + } + if (message.imageSegmentationDetails != null && message.hasOwnProperty("imageSegmentationDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.verify(message.imageSegmentationDetails); + if (error) + return "imageSegmentationDetails." + error; + } + } + if (message.videoClassificationDetails != null && message.hasOwnProperty("videoClassificationDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.verify(message.videoClassificationDetails); + if (error) + return "videoClassificationDetails." + error; + } + } + if (message.videoObjectDetectionDetails != null && message.hasOwnProperty("videoObjectDetectionDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.verify(message.videoObjectDetectionDetails); + if (error) + return "videoObjectDetectionDetails." + error; + } + } + if (message.videoObjectTrackingDetails != null && message.hasOwnProperty("videoObjectTrackingDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.verify(message.videoObjectTrackingDetails); + if (error) + return "videoObjectTrackingDetails." + error; + } + } + if (message.videoEventDetails != null && message.hasOwnProperty("videoEventDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.verify(message.videoEventDetails); + if (error) + return "videoEventDetails." + error; + } + } + if (message.textClassificationDetails != null && message.hasOwnProperty("textClassificationDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.verify(message.textClassificationDetails); + if (error) + return "textClassificationDetails." + error; + } + } + if (message.textEntityExtractionDetails != null && message.hasOwnProperty("textEntityExtractionDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.verify(message.textEntityExtractionDetails); + if (error) + return "textEntityExtractionDetails." + error; + } + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.partialFailures != null && message.hasOwnProperty("partialFailures")) { + if (!Array.isArray(message.partialFailures)) + return "partialFailures: array expected"; + for (var i = 0; i < message.partialFailures.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialFailures[i]); + if (error) + return "partialFailures." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a LabelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelOperationMetadata} LabelOperationMetadata + */ + LabelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelOperationMetadata(); + if (object.imageClassificationDetails != null) { + if (typeof object.imageClassificationDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.imageClassificationDetails: object expected"); + message.imageClassificationDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.fromObject(object.imageClassificationDetails); + } + if (object.imageBoundingBoxDetails != null) { + if (typeof object.imageBoundingBoxDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.imageBoundingBoxDetails: object expected"); + message.imageBoundingBoxDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.fromObject(object.imageBoundingBoxDetails); + } + if (object.imageBoundingPolyDetails != null) { + if (typeof object.imageBoundingPolyDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.imageBoundingPolyDetails: object expected"); + message.imageBoundingPolyDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.fromObject(object.imageBoundingPolyDetails); + } + if (object.imageOrientedBoundingBoxDetails != null) { + if (typeof object.imageOrientedBoundingBoxDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.imageOrientedBoundingBoxDetails: object expected"); + message.imageOrientedBoundingBoxDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.fromObject(object.imageOrientedBoundingBoxDetails); + } + if (object.imagePolylineDetails != null) { + if (typeof object.imagePolylineDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.imagePolylineDetails: object expected"); + message.imagePolylineDetails = $root.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.fromObject(object.imagePolylineDetails); + } + if (object.imageSegmentationDetails != null) { + if (typeof object.imageSegmentationDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.imageSegmentationDetails: object expected"); + message.imageSegmentationDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.fromObject(object.imageSegmentationDetails); + } + if (object.videoClassificationDetails != null) { + if (typeof object.videoClassificationDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.videoClassificationDetails: object expected"); + message.videoClassificationDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.fromObject(object.videoClassificationDetails); + } + if (object.videoObjectDetectionDetails != null) { + if (typeof object.videoObjectDetectionDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.videoObjectDetectionDetails: object expected"); + message.videoObjectDetectionDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.fromObject(object.videoObjectDetectionDetails); + } + if (object.videoObjectTrackingDetails != null) { + if (typeof object.videoObjectTrackingDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.videoObjectTrackingDetails: object expected"); + message.videoObjectTrackingDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.fromObject(object.videoObjectTrackingDetails); + } + if (object.videoEventDetails != null) { + if (typeof object.videoEventDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.videoEventDetails: object expected"); + message.videoEventDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.fromObject(object.videoEventDetails); + } + if (object.textClassificationDetails != null) { + if (typeof object.textClassificationDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.textClassificationDetails: object expected"); + message.textClassificationDetails = $root.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.fromObject(object.textClassificationDetails); + } + if (object.textEntityExtractionDetails != null) { + if (typeof object.textEntityExtractionDetails !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.textEntityExtractionDetails: object expected"); + message.textEntityExtractionDetails = $root.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.fromObject(object.textEntityExtractionDetails); + } + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.partialFailures: object expected"); + message.partialFailures[i] = $root.google.rpc.Status.fromObject(object.partialFailures[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a LabelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelOperationMetadata} message LabelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) { + object.progressPercent = 0; + object.createTime = null; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.partialFailures && message.partialFailures.length) { + object.partialFailures = []; + for (var j = 0; j < message.partialFailures.length; ++j) + object.partialFailures[j] = $root.google.rpc.Status.toObject(message.partialFailures[j], options); + } + if (message.imageClassificationDetails != null && message.hasOwnProperty("imageClassificationDetails")) { + object.imageClassificationDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.toObject(message.imageClassificationDetails, options); + if (options.oneofs) + object.details = "imageClassificationDetails"; + } + if (message.imageBoundingBoxDetails != null && message.hasOwnProperty("imageBoundingBoxDetails")) { + object.imageBoundingBoxDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.toObject(message.imageBoundingBoxDetails, options); + if (options.oneofs) + object.details = "imageBoundingBoxDetails"; + } + if (message.videoClassificationDetails != null && message.hasOwnProperty("videoClassificationDetails")) { + object.videoClassificationDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.toObject(message.videoClassificationDetails, options); + if (options.oneofs) + object.details = "videoClassificationDetails"; + } + if (message.videoObjectDetectionDetails != null && message.hasOwnProperty("videoObjectDetectionDetails")) { + object.videoObjectDetectionDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.toObject(message.videoObjectDetectionDetails, options); + if (options.oneofs) + object.details = "videoObjectDetectionDetails"; + } + if (message.videoObjectTrackingDetails != null && message.hasOwnProperty("videoObjectTrackingDetails")) { + object.videoObjectTrackingDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.toObject(message.videoObjectTrackingDetails, options); + if (options.oneofs) + object.details = "videoObjectTrackingDetails"; + } + if (message.videoEventDetails != null && message.hasOwnProperty("videoEventDetails")) { + object.videoEventDetails = $root.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.toObject(message.videoEventDetails, options); + if (options.oneofs) + object.details = "videoEventDetails"; + } + if (message.textClassificationDetails != null && message.hasOwnProperty("textClassificationDetails")) { + object.textClassificationDetails = $root.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.toObject(message.textClassificationDetails, options); + if (options.oneofs) + object.details = "textClassificationDetails"; + } + if (message.imageBoundingPolyDetails != null && message.hasOwnProperty("imageBoundingPolyDetails")) { + object.imageBoundingPolyDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.toObject(message.imageBoundingPolyDetails, options); + if (options.oneofs) + object.details = "imageBoundingPolyDetails"; + } + if (message.imagePolylineDetails != null && message.hasOwnProperty("imagePolylineDetails")) { + object.imagePolylineDetails = $root.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.toObject(message.imagePolylineDetails, options); + if (options.oneofs) + object.details = "imagePolylineDetails"; + } + if (message.textEntityExtractionDetails != null && message.hasOwnProperty("textEntityExtractionDetails")) { + object.textEntityExtractionDetails = $root.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.toObject(message.textEntityExtractionDetails, options); + if (options.oneofs) + object.details = "textEntityExtractionDetails"; + } + if (message.imageOrientedBoundingBoxDetails != null && message.hasOwnProperty("imageOrientedBoundingBoxDetails")) { + object.imageOrientedBoundingBoxDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.toObject(message.imageOrientedBoundingBoxDetails, options); + if (options.oneofs) + object.details = "imageOrientedBoundingBoxDetails"; + } + if (message.imageSegmentationDetails != null && message.hasOwnProperty("imageSegmentationDetails")) { + object.imageSegmentationDetails = $root.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.toObject(message.imageSegmentationDetails, options); + if (options.oneofs) + object.details = "imageSegmentationDetails"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this LabelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelOperationMetadata"; + }; + + return LabelOperationMetadata; + })(); + + v1beta1.LabelImageClassificationOperationMetadata = (function() { + + /** + * Properties of a LabelImageClassificationOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelImageClassificationOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelImageClassificationOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelImageClassificationOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelImageClassificationOperationMetadata. + * @implements ILabelImageClassificationOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata=} [properties] Properties to set + */ + function LabelImageClassificationOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelImageClassificationOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @instance + */ + LabelImageClassificationOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelImageClassificationOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata} LabelImageClassificationOperationMetadata instance + */ + LabelImageClassificationOperationMetadata.create = function create(properties) { + return new LabelImageClassificationOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelImageClassificationOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata} message LabelImageClassificationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageClassificationOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelImageClassificationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageClassificationOperationMetadata} message LabelImageClassificationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageClassificationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelImageClassificationOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata} LabelImageClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageClassificationOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelImageClassificationOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata} LabelImageClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageClassificationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelImageClassificationOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelImageClassificationOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelImageClassificationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata} LabelImageClassificationOperationMetadata + */ + LabelImageClassificationOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelImageClassificationOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata} message LabelImageClassificationOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelImageClassificationOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelImageClassificationOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelImageClassificationOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelImageClassificationOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelImageClassificationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata"; + }; + + return LabelImageClassificationOperationMetadata; + })(); + + v1beta1.LabelImageBoundingBoxOperationMetadata = (function() { + + /** + * Properties of a LabelImageBoundingBoxOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelImageBoundingBoxOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelImageBoundingBoxOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelImageBoundingBoxOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelImageBoundingBoxOperationMetadata. + * @implements ILabelImageBoundingBoxOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata=} [properties] Properties to set + */ + function LabelImageBoundingBoxOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelImageBoundingBoxOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @instance + */ + LabelImageBoundingBoxOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelImageBoundingBoxOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata} LabelImageBoundingBoxOperationMetadata instance + */ + LabelImageBoundingBoxOperationMetadata.create = function create(properties) { + return new LabelImageBoundingBoxOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelImageBoundingBoxOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata} message LabelImageBoundingBoxOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageBoundingBoxOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelImageBoundingBoxOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageBoundingBoxOperationMetadata} message LabelImageBoundingBoxOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageBoundingBoxOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelImageBoundingBoxOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata} LabelImageBoundingBoxOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageBoundingBoxOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelImageBoundingBoxOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata} LabelImageBoundingBoxOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageBoundingBoxOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelImageBoundingBoxOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelImageBoundingBoxOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelImageBoundingBoxOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata} LabelImageBoundingBoxOperationMetadata + */ + LabelImageBoundingBoxOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelImageBoundingBoxOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata} message LabelImageBoundingBoxOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelImageBoundingBoxOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelImageBoundingBoxOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelImageBoundingBoxOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelImageBoundingBoxOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelImageBoundingBoxOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata"; + }; + + return LabelImageBoundingBoxOperationMetadata; + })(); + + v1beta1.LabelImageOrientedBoundingBoxOperationMetadata = (function() { + + /** + * Properties of a LabelImageOrientedBoundingBoxOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelImageOrientedBoundingBoxOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelImageOrientedBoundingBoxOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelImageOrientedBoundingBoxOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelImageOrientedBoundingBoxOperationMetadata. + * @implements ILabelImageOrientedBoundingBoxOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata=} [properties] Properties to set + */ + function LabelImageOrientedBoundingBoxOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelImageOrientedBoundingBoxOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @instance + */ + LabelImageOrientedBoundingBoxOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelImageOrientedBoundingBoxOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata} LabelImageOrientedBoundingBoxOperationMetadata instance + */ + LabelImageOrientedBoundingBoxOperationMetadata.create = function create(properties) { + return new LabelImageOrientedBoundingBoxOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelImageOrientedBoundingBoxOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata} message LabelImageOrientedBoundingBoxOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageOrientedBoundingBoxOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelImageOrientedBoundingBoxOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageOrientedBoundingBoxOperationMetadata} message LabelImageOrientedBoundingBoxOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageOrientedBoundingBoxOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelImageOrientedBoundingBoxOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata} LabelImageOrientedBoundingBoxOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageOrientedBoundingBoxOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelImageOrientedBoundingBoxOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata} LabelImageOrientedBoundingBoxOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageOrientedBoundingBoxOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelImageOrientedBoundingBoxOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelImageOrientedBoundingBoxOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelImageOrientedBoundingBoxOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata} LabelImageOrientedBoundingBoxOperationMetadata + */ + LabelImageOrientedBoundingBoxOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelImageOrientedBoundingBoxOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata} message LabelImageOrientedBoundingBoxOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelImageOrientedBoundingBoxOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelImageOrientedBoundingBoxOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelImageOrientedBoundingBoxOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelImageOrientedBoundingBoxOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelImageOrientedBoundingBoxOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata"; + }; + + return LabelImageOrientedBoundingBoxOperationMetadata; + })(); + + v1beta1.LabelImageBoundingPolyOperationMetadata = (function() { + + /** + * Properties of a LabelImageBoundingPolyOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelImageBoundingPolyOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelImageBoundingPolyOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelImageBoundingPolyOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelImageBoundingPolyOperationMetadata. + * @implements ILabelImageBoundingPolyOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata=} [properties] Properties to set + */ + function LabelImageBoundingPolyOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelImageBoundingPolyOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @instance + */ + LabelImageBoundingPolyOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelImageBoundingPolyOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata} LabelImageBoundingPolyOperationMetadata instance + */ + LabelImageBoundingPolyOperationMetadata.create = function create(properties) { + return new LabelImageBoundingPolyOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelImageBoundingPolyOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata} message LabelImageBoundingPolyOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageBoundingPolyOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelImageBoundingPolyOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageBoundingPolyOperationMetadata} message LabelImageBoundingPolyOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageBoundingPolyOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelImageBoundingPolyOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata} LabelImageBoundingPolyOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageBoundingPolyOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelImageBoundingPolyOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata} LabelImageBoundingPolyOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageBoundingPolyOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelImageBoundingPolyOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelImageBoundingPolyOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelImageBoundingPolyOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata} LabelImageBoundingPolyOperationMetadata + */ + LabelImageBoundingPolyOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelImageBoundingPolyOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata} message LabelImageBoundingPolyOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelImageBoundingPolyOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelImageBoundingPolyOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelImageBoundingPolyOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelImageBoundingPolyOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelImageBoundingPolyOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata"; + }; + + return LabelImageBoundingPolyOperationMetadata; + })(); + + v1beta1.LabelImagePolylineOperationMetadata = (function() { + + /** + * Properties of a LabelImagePolylineOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelImagePolylineOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelImagePolylineOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelImagePolylineOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelImagePolylineOperationMetadata. + * @implements ILabelImagePolylineOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata=} [properties] Properties to set + */ + function LabelImagePolylineOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelImagePolylineOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @instance + */ + LabelImagePolylineOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelImagePolylineOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata} LabelImagePolylineOperationMetadata instance + */ + LabelImagePolylineOperationMetadata.create = function create(properties) { + return new LabelImagePolylineOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelImagePolylineOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata} message LabelImagePolylineOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImagePolylineOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelImagePolylineOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImagePolylineOperationMetadata} message LabelImagePolylineOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImagePolylineOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelImagePolylineOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata} LabelImagePolylineOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImagePolylineOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelImagePolylineOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata} LabelImagePolylineOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImagePolylineOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelImagePolylineOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelImagePolylineOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelImagePolylineOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata} LabelImagePolylineOperationMetadata + */ + LabelImagePolylineOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelImagePolylineOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata} message LabelImagePolylineOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelImagePolylineOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelImagePolylineOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelImagePolylineOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelImagePolylineOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelImagePolylineOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata"; + }; + + return LabelImagePolylineOperationMetadata; + })(); + + v1beta1.LabelImageSegmentationOperationMetadata = (function() { + + /** + * Properties of a LabelImageSegmentationOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelImageSegmentationOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelImageSegmentationOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelImageSegmentationOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelImageSegmentationOperationMetadata. + * @implements ILabelImageSegmentationOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata=} [properties] Properties to set + */ + function LabelImageSegmentationOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelImageSegmentationOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @instance + */ + LabelImageSegmentationOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelImageSegmentationOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata} LabelImageSegmentationOperationMetadata instance + */ + LabelImageSegmentationOperationMetadata.create = function create(properties) { + return new LabelImageSegmentationOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelImageSegmentationOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata} message LabelImageSegmentationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageSegmentationOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelImageSegmentationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelImageSegmentationOperationMetadata} message LabelImageSegmentationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelImageSegmentationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelImageSegmentationOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata} LabelImageSegmentationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageSegmentationOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelImageSegmentationOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata} LabelImageSegmentationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelImageSegmentationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelImageSegmentationOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelImageSegmentationOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelImageSegmentationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata} LabelImageSegmentationOperationMetadata + */ + LabelImageSegmentationOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelImageSegmentationOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata} message LabelImageSegmentationOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelImageSegmentationOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelImageSegmentationOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelImageSegmentationOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelImageSegmentationOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelImageSegmentationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata"; + }; + + return LabelImageSegmentationOperationMetadata; + })(); + + v1beta1.LabelVideoClassificationOperationMetadata = (function() { + + /** + * Properties of a LabelVideoClassificationOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelVideoClassificationOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelVideoClassificationOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelVideoClassificationOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelVideoClassificationOperationMetadata. + * @implements ILabelVideoClassificationOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata=} [properties] Properties to set + */ + function LabelVideoClassificationOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelVideoClassificationOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @instance + */ + LabelVideoClassificationOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelVideoClassificationOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata} LabelVideoClassificationOperationMetadata instance + */ + LabelVideoClassificationOperationMetadata.create = function create(properties) { + return new LabelVideoClassificationOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelVideoClassificationOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata} message LabelVideoClassificationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoClassificationOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelVideoClassificationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoClassificationOperationMetadata} message LabelVideoClassificationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoClassificationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelVideoClassificationOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata} LabelVideoClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoClassificationOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelVideoClassificationOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata} LabelVideoClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoClassificationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelVideoClassificationOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelVideoClassificationOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelVideoClassificationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata} LabelVideoClassificationOperationMetadata + */ + LabelVideoClassificationOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelVideoClassificationOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata} message LabelVideoClassificationOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelVideoClassificationOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelVideoClassificationOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelVideoClassificationOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelVideoClassificationOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelVideoClassificationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata"; + }; + + return LabelVideoClassificationOperationMetadata; + })(); + + v1beta1.LabelVideoObjectDetectionOperationMetadata = (function() { + + /** + * Properties of a LabelVideoObjectDetectionOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelVideoObjectDetectionOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelVideoObjectDetectionOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelVideoObjectDetectionOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelVideoObjectDetectionOperationMetadata. + * @implements ILabelVideoObjectDetectionOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata=} [properties] Properties to set + */ + function LabelVideoObjectDetectionOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelVideoObjectDetectionOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @instance + */ + LabelVideoObjectDetectionOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelVideoObjectDetectionOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata} LabelVideoObjectDetectionOperationMetadata instance + */ + LabelVideoObjectDetectionOperationMetadata.create = function create(properties) { + return new LabelVideoObjectDetectionOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelVideoObjectDetectionOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata} message LabelVideoObjectDetectionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoObjectDetectionOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelVideoObjectDetectionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoObjectDetectionOperationMetadata} message LabelVideoObjectDetectionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoObjectDetectionOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelVideoObjectDetectionOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata} LabelVideoObjectDetectionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoObjectDetectionOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelVideoObjectDetectionOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata} LabelVideoObjectDetectionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoObjectDetectionOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelVideoObjectDetectionOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelVideoObjectDetectionOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelVideoObjectDetectionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata} LabelVideoObjectDetectionOperationMetadata + */ + LabelVideoObjectDetectionOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelVideoObjectDetectionOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata} message LabelVideoObjectDetectionOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelVideoObjectDetectionOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelVideoObjectDetectionOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelVideoObjectDetectionOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelVideoObjectDetectionOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelVideoObjectDetectionOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata"; + }; + + return LabelVideoObjectDetectionOperationMetadata; + })(); + + v1beta1.LabelVideoObjectTrackingOperationMetadata = (function() { + + /** + * Properties of a LabelVideoObjectTrackingOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelVideoObjectTrackingOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelVideoObjectTrackingOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelVideoObjectTrackingOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelVideoObjectTrackingOperationMetadata. + * @implements ILabelVideoObjectTrackingOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata=} [properties] Properties to set + */ + function LabelVideoObjectTrackingOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelVideoObjectTrackingOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @instance + */ + LabelVideoObjectTrackingOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelVideoObjectTrackingOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata} LabelVideoObjectTrackingOperationMetadata instance + */ + LabelVideoObjectTrackingOperationMetadata.create = function create(properties) { + return new LabelVideoObjectTrackingOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelVideoObjectTrackingOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata} message LabelVideoObjectTrackingOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoObjectTrackingOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelVideoObjectTrackingOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoObjectTrackingOperationMetadata} message LabelVideoObjectTrackingOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoObjectTrackingOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelVideoObjectTrackingOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata} LabelVideoObjectTrackingOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoObjectTrackingOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelVideoObjectTrackingOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata} LabelVideoObjectTrackingOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoObjectTrackingOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelVideoObjectTrackingOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelVideoObjectTrackingOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelVideoObjectTrackingOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata} LabelVideoObjectTrackingOperationMetadata + */ + LabelVideoObjectTrackingOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelVideoObjectTrackingOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata} message LabelVideoObjectTrackingOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelVideoObjectTrackingOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelVideoObjectTrackingOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelVideoObjectTrackingOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelVideoObjectTrackingOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelVideoObjectTrackingOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata"; + }; + + return LabelVideoObjectTrackingOperationMetadata; + })(); + + v1beta1.LabelVideoEventOperationMetadata = (function() { + + /** + * Properties of a LabelVideoEventOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelVideoEventOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelVideoEventOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelVideoEventOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelVideoEventOperationMetadata. + * @implements ILabelVideoEventOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata=} [properties] Properties to set + */ + function LabelVideoEventOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelVideoEventOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @instance + */ + LabelVideoEventOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelVideoEventOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata} LabelVideoEventOperationMetadata instance + */ + LabelVideoEventOperationMetadata.create = function create(properties) { + return new LabelVideoEventOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelVideoEventOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata} message LabelVideoEventOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoEventOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelVideoEventOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelVideoEventOperationMetadata} message LabelVideoEventOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelVideoEventOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelVideoEventOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata} LabelVideoEventOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoEventOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelVideoEventOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata} LabelVideoEventOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelVideoEventOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelVideoEventOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelVideoEventOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelVideoEventOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata} LabelVideoEventOperationMetadata + */ + LabelVideoEventOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelVideoEventOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata} message LabelVideoEventOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelVideoEventOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelVideoEventOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelVideoEventOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelVideoEventOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelVideoEventOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata"; + }; + + return LabelVideoEventOperationMetadata; + })(); + + v1beta1.LabelTextClassificationOperationMetadata = (function() { + + /** + * Properties of a LabelTextClassificationOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelTextClassificationOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelTextClassificationOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelTextClassificationOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelTextClassificationOperationMetadata. + * @implements ILabelTextClassificationOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata=} [properties] Properties to set + */ + function LabelTextClassificationOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelTextClassificationOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @instance + */ + LabelTextClassificationOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelTextClassificationOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata} LabelTextClassificationOperationMetadata instance + */ + LabelTextClassificationOperationMetadata.create = function create(properties) { + return new LabelTextClassificationOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelTextClassificationOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata} message LabelTextClassificationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelTextClassificationOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelTextClassificationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelTextClassificationOperationMetadata} message LabelTextClassificationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelTextClassificationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelTextClassificationOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata} LabelTextClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelTextClassificationOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelTextClassificationOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata} LabelTextClassificationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelTextClassificationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelTextClassificationOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelTextClassificationOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelTextClassificationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata} LabelTextClassificationOperationMetadata + */ + LabelTextClassificationOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelTextClassificationOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata} message LabelTextClassificationOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelTextClassificationOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelTextClassificationOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelTextClassificationOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelTextClassificationOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelTextClassificationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata"; + }; + + return LabelTextClassificationOperationMetadata; + })(); + + v1beta1.LabelTextEntityExtractionOperationMetadata = (function() { + + /** + * Properties of a LabelTextEntityExtractionOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ILabelTextEntityExtractionOperationMetadata + * @property {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null} [basicConfig] LabelTextEntityExtractionOperationMetadata basicConfig + */ + + /** + * Constructs a new LabelTextEntityExtractionOperationMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a LabelTextEntityExtractionOperationMetadata. + * @implements ILabelTextEntityExtractionOperationMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata=} [properties] Properties to set + */ + function LabelTextEntityExtractionOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelTextEntityExtractionOperationMetadata basicConfig. + * @member {google.cloud.datalabeling.v1beta1.IHumanAnnotationConfig|null|undefined} basicConfig + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @instance + */ + LabelTextEntityExtractionOperationMetadata.prototype.basicConfig = null; + + /** + * Creates a new LabelTextEntityExtractionOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata} LabelTextEntityExtractionOperationMetadata instance + */ + LabelTextEntityExtractionOperationMetadata.create = function create(properties) { + return new LabelTextEntityExtractionOperationMetadata(properties); + }; + + /** + * Encodes the specified LabelTextEntityExtractionOperationMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata} message LabelTextEntityExtractionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelTextEntityExtractionOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basicConfig != null && Object.hasOwnProperty.call(message, "basicConfig")) + $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.encode(message.basicConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelTextEntityExtractionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ILabelTextEntityExtractionOperationMetadata} message LabelTextEntityExtractionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelTextEntityExtractionOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelTextEntityExtractionOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata} LabelTextEntityExtractionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelTextEntityExtractionOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelTextEntityExtractionOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata} LabelTextEntityExtractionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelTextEntityExtractionOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelTextEntityExtractionOperationMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelTextEntityExtractionOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) { + var error = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.verify(message.basicConfig); + if (error) + return "basicConfig." + error; + } + return null; + }; + + /** + * Creates a LabelTextEntityExtractionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata} LabelTextEntityExtractionOperationMetadata + */ + LabelTextEntityExtractionOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata(); + if (object.basicConfig != null) { + if (typeof object.basicConfig !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.basicConfig: object expected"); + message.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.fromObject(object.basicConfig); + } + return message; + }; + + /** + * Creates a plain object from a LabelTextEntityExtractionOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata} message LabelTextEntityExtractionOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelTextEntityExtractionOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.basicConfig = null; + if (message.basicConfig != null && message.hasOwnProperty("basicConfig")) + object.basicConfig = $root.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.toObject(message.basicConfig, options); + return object; + }; + + /** + * Converts this LabelTextEntityExtractionOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + LabelTextEntityExtractionOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelTextEntityExtractionOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelTextEntityExtractionOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata"; + }; + + return LabelTextEntityExtractionOperationMetadata; + })(); + + v1beta1.CreateInstructionMetadata = (function() { + + /** + * Properties of a CreateInstructionMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @interface ICreateInstructionMetadata + * @property {string|null} [instruction] CreateInstructionMetadata instruction + * @property {Array.|null} [partialFailures] CreateInstructionMetadata partialFailures + * @property {google.protobuf.ITimestamp|null} [createTime] CreateInstructionMetadata createTime + */ + + /** + * Constructs a new CreateInstructionMetadata. + * @memberof google.cloud.datalabeling.v1beta1 + * @classdesc Represents a CreateInstructionMetadata. + * @implements ICreateInstructionMetadata + * @constructor + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata=} [properties] Properties to set + */ + function CreateInstructionMetadata(properties) { + this.partialFailures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstructionMetadata instruction. + * @member {string} instruction + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @instance + */ + CreateInstructionMetadata.prototype.instruction = ""; + + /** + * CreateInstructionMetadata partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @instance + */ + CreateInstructionMetadata.prototype.partialFailures = $util.emptyArray; + + /** + * CreateInstructionMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @instance + */ + CreateInstructionMetadata.prototype.createTime = null; + + /** + * Creates a new CreateInstructionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata=} [properties] Properties to set + * @returns {google.cloud.datalabeling.v1beta1.CreateInstructionMetadata} CreateInstructionMetadata instance + */ + CreateInstructionMetadata.create = function create(properties) { + return new CreateInstructionMetadata(properties); + }; + + /** + * Encodes the specified CreateInstructionMetadata message. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata} message CreateInstructionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstructionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instruction); + if (message.partialFailures != null && message.partialFailures.length) + for (var i = 0; i < message.partialFailures.length; ++i) + $root.google.rpc.Status.encode(message.partialFailures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstructionMetadata message, length delimited. Does not implicitly {@link google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata} message CreateInstructionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstructionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstructionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datalabeling.v1beta1.CreateInstructionMetadata} CreateInstructionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstructionMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instruction = reader.string(); + break; + } + case 2: { + if (!(message.partialFailures && message.partialFailures.length)) + message.partialFailures = []; + message.partialFailures.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstructionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datalabeling.v1beta1.CreateInstructionMetadata} CreateInstructionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstructionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstructionMetadata message. + * @function verify + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstructionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instruction != null && message.hasOwnProperty("instruction")) + if (!$util.isString(message.instruction)) + return "instruction: string expected"; + if (message.partialFailures != null && message.hasOwnProperty("partialFailures")) { + if (!Array.isArray(message.partialFailures)) + return "partialFailures: array expected"; + for (var i = 0; i < message.partialFailures.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialFailures[i]); + if (error) + return "partialFailures." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a CreateInstructionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datalabeling.v1beta1.CreateInstructionMetadata} CreateInstructionMetadata + */ + CreateInstructionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata) + return object; + var message = new $root.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata(); + if (object.instruction != null) + message.instruction = String(object.instruction); + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.partialFailures: object expected"); + message.partialFailures[i] = $root.google.rpc.Status.fromObject(object.partialFailures[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstructionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @static + * @param {google.cloud.datalabeling.v1beta1.CreateInstructionMetadata} message CreateInstructionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstructionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) { + object.instruction = ""; + object.createTime = null; + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = message.instruction; + if (message.partialFailures && message.partialFailures.length) { + object.partialFailures = []; + for (var j = 0; j < message.partialFailures.length; ++j) + object.partialFailures[j] = $root.google.rpc.Status.toObject(message.partialFailures[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this CreateInstructionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateInstructionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstructionMetadata + * @function getTypeUrl + * @memberof google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstructionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datalabeling.v1beta1.CreateInstructionMetadata"; + }; + + return CreateInstructionMetadata; + })(); + + return v1beta1; + })(); + + return datalabeling; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + /** + * 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 + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @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.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * 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(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + 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.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + 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; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-datalabeling/protos/protos.json b/packages/google-cloud-datalabeling/protos/protos.json new file mode 100644 index 00000000000..6d24da13f78 --- /dev/null +++ b/packages/google-cloud-datalabeling/protos/protos.json @@ -0,0 +1,4894 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "datalabeling": { + "nested": { + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.DataLabeling.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling", + "java_multiple_files": true, + "java_package": "com.google.cloud.datalabeling.v1beta1", + "php_namespace": "Google\\Cloud\\DataLabeling\\V1beta1", + "ruby_package": "Google::Cloud::DataLabeling::V1beta1" + }, + "nested": { + "AnnotationSource": { + "values": { + "ANNOTATION_SOURCE_UNSPECIFIED": 0, + "OPERATOR": 3 + } + }, + "Annotation": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "annotationSource": { + "type": "AnnotationSource", + "id": 2 + }, + "annotationValue": { + "type": "AnnotationValue", + "id": 3 + }, + "annotationMetadata": { + "type": "AnnotationMetadata", + "id": 4 + }, + "annotationSentiment": { + "type": "AnnotationSentiment", + "id": 6 + } + } + }, + "AnnotationSentiment": { + "values": { + "ANNOTATION_SENTIMENT_UNSPECIFIED": 0, + "NEGATIVE": 1, + "POSITIVE": 2 + } + }, + "AnnotationType": { + "values": { + "ANNOTATION_TYPE_UNSPECIFIED": 0, + "IMAGE_CLASSIFICATION_ANNOTATION": 1, + "IMAGE_BOUNDING_BOX_ANNOTATION": 2, + "IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION": 13, + "IMAGE_BOUNDING_POLY_ANNOTATION": 10, + "IMAGE_POLYLINE_ANNOTATION": 11, + "IMAGE_SEGMENTATION_ANNOTATION": 12, + "VIDEO_SHOTS_CLASSIFICATION_ANNOTATION": 3, + "VIDEO_OBJECT_TRACKING_ANNOTATION": 4, + "VIDEO_OBJECT_DETECTION_ANNOTATION": 5, + "VIDEO_EVENT_ANNOTATION": 6, + "TEXT_CLASSIFICATION_ANNOTATION": 8, + "TEXT_ENTITY_EXTRACTION_ANNOTATION": 9, + "GENERAL_CLASSIFICATION_ANNOTATION": 14 + } + }, + "AnnotationValue": { + "oneofs": { + "valueType": { + "oneof": [ + "imageClassificationAnnotation", + "imageBoundingPolyAnnotation", + "imagePolylineAnnotation", + "imageSegmentationAnnotation", + "textClassificationAnnotation", + "textEntityExtractionAnnotation", + "videoClassificationAnnotation", + "videoObjectTrackingAnnotation", + "videoEventAnnotation" + ] + } + }, + "fields": { + "imageClassificationAnnotation": { + "type": "ImageClassificationAnnotation", + "id": 1 + }, + "imageBoundingPolyAnnotation": { + "type": "ImageBoundingPolyAnnotation", + "id": 2 + }, + "imagePolylineAnnotation": { + "type": "ImagePolylineAnnotation", + "id": 8 + }, + "imageSegmentationAnnotation": { + "type": "ImageSegmentationAnnotation", + "id": 9 + }, + "textClassificationAnnotation": { + "type": "TextClassificationAnnotation", + "id": 3 + }, + "textEntityExtractionAnnotation": { + "type": "TextEntityExtractionAnnotation", + "id": 10 + }, + "videoClassificationAnnotation": { + "type": "VideoClassificationAnnotation", + "id": 4 + }, + "videoObjectTrackingAnnotation": { + "type": "VideoObjectTrackingAnnotation", + "id": 5 + }, + "videoEventAnnotation": { + "type": "VideoEventAnnotation", + "id": 6 + } + } + }, + "ImageClassificationAnnotation": { + "fields": { + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + } + } + }, + "Vertex": { + "fields": { + "x": { + "type": "int32", + "id": 1 + }, + "y": { + "type": "int32", + "id": 2 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "Vertex", + "id": 1 + } + } + }, + "NormalizedBoundingPoly": { + "fields": { + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "ImageBoundingPolyAnnotation": { + "oneofs": { + "boundedArea": { + "oneof": [ + "boundingPoly", + "normalizedBoundingPoly" + ] + } + }, + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 2 + }, + "normalizedBoundingPoly": { + "type": "NormalizedBoundingPoly", + "id": 3 + }, + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + } + } + }, + "Polyline": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "Vertex", + "id": 1 + } + } + }, + "NormalizedPolyline": { + "fields": { + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "ImagePolylineAnnotation": { + "oneofs": { + "poly": { + "oneof": [ + "polyline", + "normalizedPolyline" + ] + } + }, + "fields": { + "polyline": { + "type": "Polyline", + "id": 2 + }, + "normalizedPolyline": { + "type": "NormalizedPolyline", + "id": 3 + }, + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + } + } + }, + "ImageSegmentationAnnotation": { + "fields": { + "annotationColors": { + "keyType": "string", + "type": "AnnotationSpec", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "imageBytes": { + "type": "bytes", + "id": 3 + } + } + }, + "TextClassificationAnnotation": { + "fields": { + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + } + } + }, + "TextEntityExtractionAnnotation": { + "fields": { + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + }, + "sequentialSegment": { + "type": "SequentialSegment", + "id": 2 + } + } + }, + "SequentialSegment": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + }, + "TimeSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "VideoClassificationAnnotation": { + "fields": { + "timeSegment": { + "type": "TimeSegment", + "id": 1 + }, + "annotationSpec": { + "type": "AnnotationSpec", + "id": 2 + } + } + }, + "ObjectTrackingFrame": { + "oneofs": { + "boundedArea": { + "oneof": [ + "boundingPoly", + "normalizedBoundingPoly" + ] + } + }, + "fields": { + "boundingPoly": { + "type": "BoundingPoly", + "id": 1 + }, + "normalizedBoundingPoly": { + "type": "NormalizedBoundingPoly", + "id": 2 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + }, + "VideoObjectTrackingAnnotation": { + "fields": { + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + }, + "timeSegment": { + "type": "TimeSegment", + "id": 2 + }, + "objectTrackingFrames": { + "rule": "repeated", + "type": "ObjectTrackingFrame", + "id": 3 + } + } + }, + "VideoEventAnnotation": { + "fields": { + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + }, + "timeSegment": { + "type": "TimeSegment", + "id": 2 + } + } + }, + "AnnotationMetadata": { + "fields": { + "operatorMetadata": { + "type": "OperatorMetadata", + "id": 2 + } + } + }, + "OperatorMetadata": { + "fields": { + "score": { + "type": "float", + "id": 1 + }, + "totalVotes": { + "type": "int32", + "id": 2 + }, + "labelVotes": { + "type": "int32", + "id": 3 + }, + "comments": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "AnnotationSpecSet": { + "options": { + "(google.api.resource).type": "datalabeling.googleapis.com/AnnotationSpecSet", + "(google.api.resource).pattern": "projects/{project}/annotationSpecSets/{annotation_spec_set}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "annotationSpecs": { + "rule": "repeated", + "type": "AnnotationSpec", + "id": 4 + }, + "blockingResources": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "AnnotationSpec": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + } + } + }, + "DataLabelingService": { + "options": { + "(google.api.default_host)": "datalabeling.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDataset": { + "requestType": "CreateDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*}/datasets", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*}/datasets", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,dataset" + } + ] + }, + "GetDataset": { + "requestType": "GetDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/datasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDatasets": { + "requestType": "ListDatasetsRequest", + "responseType": "ListDatasetsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*}/datasets", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*}/datasets" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "DeleteDataset": { + "requestType": "DeleteDatasetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/datasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportData": { + "requestType": "ImportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/datasets/*}:importData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,input_config", + "(google.longrunning.operation_info).response_type": "ImportDataOperationResponse", + "(google.longrunning.operation_info).metadata_type": "ImportDataOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/datasets/*}:importData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,input_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportDataOperationResponse", + "metadata_type": "ImportDataOperationMetadata" + } + } + ] + }, + "ExportData": { + "requestType": "ExportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/datasets/*}:exportData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,annotated_dataset,filter,output_config", + "(google.longrunning.operation_info).response_type": "ExportDataOperationResponse", + "(google.longrunning.operation_info).metadata_type": "ExportDataOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/datasets/*}:exportData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,annotated_dataset,filter,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportDataOperationResponse", + "metadata_type": "ExportDataOperationMetadata" + } + } + ] + }, + "GetDataItem": { + "requestType": "GetDataItemRequest", + "responseType": "DataItem", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/datasets/*/dataItems/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/datasets/*/dataItems/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDataItems": { + "requestType": "ListDataItemsRequest", + "responseType": "ListDataItemsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/datasets/*}/dataItems", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/datasets/*}/dataItems" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "GetAnnotatedDataset": { + "requestType": "GetAnnotatedDatasetRequest", + "responseType": "AnnotatedDataset", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAnnotatedDatasets": { + "requestType": "ListAnnotatedDatasetsRequest", + "responseType": "ListAnnotatedDatasetsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "DeleteAnnotatedDataset": { + "requestType": "DeleteAnnotatedDatasetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" + } + } + ] + }, + "LabelImage": { + "requestType": "LabelImageRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/datasets/*}/image:label", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,basic_config,feature", + "(google.longrunning.operation_info).response_type": "AnnotatedDataset", + "(google.longrunning.operation_info).metadata_type": "LabelOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/datasets/*}/image:label", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,basic_config,feature" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnnotatedDataset", + "metadata_type": "LabelOperationMetadata" + } + } + ] + }, + "LabelVideo": { + "requestType": "LabelVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/datasets/*}/video:label", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,basic_config,feature", + "(google.longrunning.operation_info).response_type": "AnnotatedDataset", + "(google.longrunning.operation_info).metadata_type": "LabelOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/datasets/*}/video:label", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,basic_config,feature" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnnotatedDataset", + "metadata_type": "LabelOperationMetadata" + } + } + ] + }, + "LabelText": { + "requestType": "LabelTextRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/datasets/*}/text:label", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,basic_config,feature", + "(google.longrunning.operation_info).response_type": "AnnotatedDataset", + "(google.longrunning.operation_info).metadata_type": "LabelOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/datasets/*}/text:label", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,basic_config,feature" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnnotatedDataset", + "metadata_type": "LabelOperationMetadata" + } + } + ] + }, + "GetExample": { + "requestType": "GetExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "ListExamples": { + "requestType": "ListExamplesRequest", + "responseType": "ListExamplesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "CreateAnnotationSpecSet": { + "requestType": "CreateAnnotationSpecSetRequest", + "responseType": "AnnotationSpecSet", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*}/annotationSpecSets", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,annotation_spec_set" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*}/annotationSpecSets", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,annotation_spec_set" + } + ] + }, + "GetAnnotationSpecSet": { + "requestType": "GetAnnotationSpecSetRequest", + "responseType": "AnnotationSpecSet", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/annotationSpecSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/annotationSpecSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAnnotationSpecSets": { + "requestType": "ListAnnotationSpecSetsRequest", + "responseType": "ListAnnotationSpecSetsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*}/annotationSpecSets", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*}/annotationSpecSets" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "DeleteAnnotationSpecSet": { + "requestType": "DeleteAnnotationSpecSetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/annotationSpecSets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/annotationSpecSets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstruction": { + "requestType": "CreateInstructionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*}/instructions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,instruction", + "(google.longrunning.operation_info).response_type": "Instruction", + "(google.longrunning.operation_info).metadata_type": "CreateInstructionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*}/instructions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,instruction" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instruction", + "metadata_type": "CreateInstructionMetadata" + } + } + ] + }, + "GetInstruction": { + "requestType": "GetInstructionRequest", + "responseType": "Instruction", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/instructions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/instructions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInstructions": { + "requestType": "ListInstructionsRequest", + "responseType": "ListInstructionsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*}/instructions", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*}/instructions" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "DeleteInstruction": { + "requestType": "DeleteInstructionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/instructions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/instructions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetEvaluation": { + "requestType": "GetEvaluationRequest", + "responseType": "Evaluation", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/datasets/*/evaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/datasets/*/evaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SearchEvaluations": { + "requestType": "SearchEvaluationsRequest", + "responseType": "SearchEvaluationsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*}/evaluations:search", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*}/evaluations:search" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "SearchExampleComparisons": { + "requestType": "SearchExampleComparisonsRequest", + "responseType": "SearchExampleComparisonsResponse", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/datasets/*/evaluations/*}/exampleComparisons:search", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/datasets/*/evaluations/*}/exampleComparisons:search", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateEvaluationJob": { + "requestType": "CreateEvaluationJobRequest", + "responseType": "EvaluationJob", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*}/evaluationJobs", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*}/evaluationJobs", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,job" + } + ] + }, + "UpdateEvaluationJob": { + "requestType": "UpdateEvaluationJobRequest", + "responseType": "EvaluationJob", + "options": { + "(google.api.http).patch": "/v1beta1/{evaluation_job.name=projects/*/evaluationJobs/*}", + "(google.api.http).body": "evaluation_job", + "(google.api.method_signature)": "evaluation_job,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{evaluation_job.name=projects/*/evaluationJobs/*}", + "body": "evaluation_job" + } + }, + { + "(google.api.method_signature)": "evaluation_job,update_mask" + } + ] + }, + "GetEvaluationJob": { + "requestType": "GetEvaluationJobRequest", + "responseType": "EvaluationJob", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/evaluationJobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/evaluationJobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "PauseEvaluationJob": { + "requestType": "PauseEvaluationJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/evaluationJobs/*}:pause", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/evaluationJobs/*}:pause", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ResumeEvaluationJob": { + "requestType": "ResumeEvaluationJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/evaluationJobs/*}:resume", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/evaluationJobs/*}:resume", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteEvaluationJob": { + "requestType": "DeleteEvaluationJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/evaluationJobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/evaluationJobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListEvaluationJobs": { + "requestType": "ListEvaluationJobsRequest", + "responseType": "ListEvaluationJobsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*}/evaluationJobs", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*}/evaluationJobs" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + } + } + }, + "CreateDatasetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "dataset": { + "type": "Dataset", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Dataset" + } + } + } + }, + "ListDatasetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDatasetsResponse": { + "fields": { + "datasets": { + "rule": "repeated", + "type": "Dataset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Dataset" + } + } + } + }, + "ImportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Dataset" + } + }, + "inputConfig": { + "type": "InputConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "userEmailAddress": { + "type": "string", + "id": 3 + } + } + }, + "ExportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Dataset" + } + }, + "annotatedDataset": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/AnnotatedDataset" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputConfig": { + "type": "OutputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "userEmailAddress": { + "type": "string", + "id": 5 + } + } + }, + "GetDataItemRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/DataItem" + } + } + } + }, + "ListDataItemsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Dataset" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDataItemsResponse": { + "fields": { + "dataItems": { + "rule": "repeated", + "type": "DataItem", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAnnotatedDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/AnnotatedDataset" + } + } + } + }, + "ListAnnotatedDatasetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Dataset" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAnnotatedDatasetsResponse": { + "fields": { + "annotatedDatasets": { + "rule": "repeated", + "type": "AnnotatedDataset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteAnnotatedDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/AnnotatedDataset" + } + } + } + }, + "LabelImageRequest": { + "oneofs": { + "requestConfig": { + "oneof": [ + "imageClassificationConfig", + "boundingPolyConfig", + "polylineConfig", + "segmentationConfig" + ] + } + }, + "fields": { + "imageClassificationConfig": { + "type": "ImageClassificationConfig", + "id": 4 + }, + "boundingPolyConfig": { + "type": "BoundingPolyConfig", + "id": 5 + }, + "polylineConfig": { + "type": "PolylineConfig", + "id": 6 + }, + "segmentationConfig": { + "type": "SegmentationConfig", + "id": 7 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Dataset" + } + }, + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "feature": { + "type": "Feature", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "CLASSIFICATION": 1, + "BOUNDING_BOX": 2, + "ORIENTED_BOUNDING_BOX": 6, + "BOUNDING_POLY": 3, + "POLYLINE": 4, + "SEGMENTATION": 5 + } + } + } + }, + "LabelVideoRequest": { + "oneofs": { + "requestConfig": { + "oneof": [ + "videoClassificationConfig", + "objectDetectionConfig", + "objectTrackingConfig", + "eventConfig" + ] + } + }, + "fields": { + "videoClassificationConfig": { + "type": "VideoClassificationConfig", + "id": 4 + }, + "objectDetectionConfig": { + "type": "ObjectDetectionConfig", + "id": 5 + }, + "objectTrackingConfig": { + "type": "ObjectTrackingConfig", + "id": 6 + }, + "eventConfig": { + "type": "EventConfig", + "id": 7 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Dataset" + } + }, + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "feature": { + "type": "Feature", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "CLASSIFICATION": 1, + "OBJECT_DETECTION": 2, + "OBJECT_TRACKING": 3, + "EVENT": 4 + } + } + } + }, + "LabelTextRequest": { + "oneofs": { + "requestConfig": { + "oneof": [ + "textClassificationConfig", + "textEntityExtractionConfig" + ] + } + }, + "fields": { + "textClassificationConfig": { + "type": "TextClassificationConfig", + "id": 4 + }, + "textEntityExtractionConfig": { + "type": "TextEntityExtractionConfig", + "id": 5 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Dataset" + } + }, + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "feature": { + "type": "Feature", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "TEXT_CLASSIFICATION": 1, + "TEXT_ENTITY_EXTRACTION": 2 + } + } + } + }, + "GetExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Example" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListExamplesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/AnnotatedDataset" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListExamplesResponse": { + "fields": { + "examples": { + "rule": "repeated", + "type": "Example", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateAnnotationSpecSetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "annotationSpecSet": { + "type": "AnnotationSpecSet", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAnnotationSpecSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/AnnotationSpecSet" + } + } + } + }, + "ListAnnotationSpecSetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAnnotationSpecSetsResponse": { + "fields": { + "annotationSpecSets": { + "rule": "repeated", + "type": "AnnotationSpecSet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteAnnotationSpecSetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/AnnotationSpecSet" + } + } + } + }, + "CreateInstructionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "instruction": { + "type": "Instruction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetInstructionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Instruction" + } + } + } + }, + "DeleteInstructionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Instruction" + } + } + } + }, + "ListInstructionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstructionsResponse": { + "fields": { + "instructions": { + "rule": "repeated", + "type": "Instruction", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Evaluation" + } + } + } + }, + "SearchEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Evaluation" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchEvaluationsResponse": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchExampleComparisonsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/Evaluation" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchExampleComparisonsResponse": { + "fields": { + "exampleComparisons": { + "rule": "repeated", + "type": "ExampleComparison", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + }, + "nested": { + "ExampleComparison": { + "fields": { + "groundTruthExample": { + "type": "Example", + "id": 1 + }, + "modelCreatedExamples": { + "rule": "repeated", + "type": "Example", + "id": 2 + } + } + } + } + }, + "CreateEvaluationJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "job": { + "type": "EvaluationJob", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateEvaluationJobRequest": { + "fields": { + "evaluationJob": { + "type": "EvaluationJob", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetEvaluationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/EvaluationJob" + } + } + } + }, + "PauseEvaluationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/EvaluationJob" + } + } + } + }, + "ResumeEvaluationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/EvaluationJob" + } + } + } + }, + "DeleteEvaluationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datalabeling.googleapis.com/EvaluationJob" + } + } + } + }, + "ListEvaluationJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListEvaluationJobsResponse": { + "fields": { + "evaluationJobs": { + "rule": "repeated", + "type": "EvaluationJob", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DataType": { + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "IMAGE": 1, + "VIDEO": 2, + "TEXT": 4, + "GENERAL_DATA": 6 + } + }, + "Dataset": { + "options": { + "(google.api.resource).type": "datalabeling.googleapis.com/Dataset", + "(google.api.resource).pattern": "projects/{project}/datasets/{dataset}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "inputConfigs": { + "rule": "repeated", + "type": "InputConfig", + "id": 5 + }, + "blockingResources": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "dataItemCount": { + "type": "int64", + "id": 7 + } + } + }, + "InputConfig": { + "oneofs": { + "dataTypeMetadata": { + "oneof": [ + "textMetadata" + ] + }, + "source": { + "oneof": [ + "gcsSource", + "bigquerySource" + ] + } + }, + "fields": { + "textMetadata": { + "type": "TextMetadata", + "id": 6 + }, + "gcsSource": { + "type": "GcsSource", + "id": 2 + }, + "bigquerySource": { + "type": "BigQuerySource", + "id": 5 + }, + "dataType": { + "type": "DataType", + "id": 1 + }, + "annotationType": { + "type": "AnnotationType", + "id": 3 + }, + "classificationMetadata": { + "type": "ClassificationMetadata", + "id": 4 + } + } + }, + "TextMetadata": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + } + } + }, + "ClassificationMetadata": { + "fields": { + "isMultiLabel": { + "type": "bool", + "id": 1 + } + } + }, + "GcsSource": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "BigQuerySource": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "gcsFolderDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "gcsFolderDestination": { + "type": "GcsFolderDestination", + "id": 2 + } + } + }, + "GcsDestination": { + "fields": { + "outputUri": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "GcsFolderDestination": { + "fields": { + "outputFolderUri": { + "type": "string", + "id": 1 + } + } + }, + "DataItem": { + "options": { + "(google.api.resource).type": "datalabeling.googleapis.com/DataItem", + "(google.api.resource).pattern": "projects/{project}/datasets/{dataset}/dataItems/{data_item}" + }, + "oneofs": { + "payload": { + "oneof": [ + "imagePayload", + "textPayload", + "videoPayload" + ] + } + }, + "fields": { + "imagePayload": { + "type": "ImagePayload", + "id": 2 + }, + "textPayload": { + "type": "TextPayload", + "id": 3 + }, + "videoPayload": { + "type": "VideoPayload", + "id": 4 + }, + "name": { + "type": "string", + "id": 1 + } + } + }, + "AnnotatedDataset": { + "options": { + "(google.api.resource).type": "datalabeling.googleapis.com/AnnotatedDataset", + "(google.api.resource).pattern": "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 9 + }, + "annotationSource": { + "type": "AnnotationSource", + "id": 3 + }, + "annotationType": { + "type": "AnnotationType", + "id": 8 + }, + "exampleCount": { + "type": "int64", + "id": 4 + }, + "completedExampleCount": { + "type": "int64", + "id": 5 + }, + "labelStats": { + "type": "LabelStats", + "id": 6 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "metadata": { + "type": "AnnotatedDatasetMetadata", + "id": 10 + }, + "blockingResources": { + "rule": "repeated", + "type": "string", + "id": 11 + } + } + }, + "LabelStats": { + "fields": { + "exampleCount": { + "keyType": "string", + "type": "int64", + "id": 1 + } + } + }, + "AnnotatedDatasetMetadata": { + "oneofs": { + "annotationRequestConfig": { + "oneof": [ + "imageClassificationConfig", + "boundingPolyConfig", + "polylineConfig", + "segmentationConfig", + "videoClassificationConfig", + "objectDetectionConfig", + "objectTrackingConfig", + "eventConfig", + "textClassificationConfig", + "textEntityExtractionConfig" + ] + } + }, + "fields": { + "imageClassificationConfig": { + "type": "ImageClassificationConfig", + "id": 2 + }, + "boundingPolyConfig": { + "type": "BoundingPolyConfig", + "id": 3 + }, + "polylineConfig": { + "type": "PolylineConfig", + "id": 4 + }, + "segmentationConfig": { + "type": "SegmentationConfig", + "id": 5 + }, + "videoClassificationConfig": { + "type": "VideoClassificationConfig", + "id": 6 + }, + "objectDetectionConfig": { + "type": "ObjectDetectionConfig", + "id": 7 + }, + "objectTrackingConfig": { + "type": "ObjectTrackingConfig", + "id": 8 + }, + "eventConfig": { + "type": "EventConfig", + "id": 9 + }, + "textClassificationConfig": { + "type": "TextClassificationConfig", + "id": 10 + }, + "textEntityExtractionConfig": { + "type": "TextEntityExtractionConfig", + "id": 11 + }, + "humanAnnotationConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "Example": { + "options": { + "(google.api.resource).type": "datalabeling.googleapis.com/Example", + "(google.api.resource).pattern": "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}" + }, + "oneofs": { + "payload": { + "oneof": [ + "imagePayload", + "textPayload", + "videoPayload" + ] + } + }, + "fields": { + "imagePayload": { + "type": "ImagePayload", + "id": 2 + }, + "textPayload": { + "type": "TextPayload", + "id": 6 + }, + "videoPayload": { + "type": "VideoPayload", + "id": 7 + }, + "name": { + "type": "string", + "id": 1 + }, + "annotations": { + "rule": "repeated", + "type": "Annotation", + "id": 5 + } + } + }, + "ImagePayload": { + "fields": { + "mimeType": { + "type": "string", + "id": 1 + }, + "imageThumbnail": { + "type": "bytes", + "id": 2 + }, + "imageUri": { + "type": "string", + "id": 3 + }, + "signedUri": { + "type": "string", + "id": 4 + } + } + }, + "TextPayload": { + "fields": { + "textContent": { + "type": "string", + "id": 1 + } + } + }, + "VideoThumbnail": { + "fields": { + "thumbnail": { + "type": "bytes", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "VideoPayload": { + "fields": { + "mimeType": { + "type": "string", + "id": 1 + }, + "videoUri": { + "type": "string", + "id": 2 + }, + "videoThumbnails": { + "rule": "repeated", + "type": "VideoThumbnail", + "id": 3 + }, + "frameRate": { + "type": "float", + "id": 4 + }, + "signedUri": { + "type": "string", + "id": 5 + } + } + }, + "StringAggregationType": { + "values": { + "STRING_AGGREGATION_TYPE_UNSPECIFIED": 0, + "MAJORITY_VOTE": 1, + "UNANIMOUS_VOTE": 2, + "NO_AGGREGATION": 3 + } + }, + "HumanAnnotationConfig": { + "fields": { + "instruction": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "annotatedDatasetDisplayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "annotatedDatasetDescription": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labelGroup": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "replicaCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "questionDuration": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contributorEmails": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userEmailAddress": { + "type": "string", + "id": 10 + } + } + }, + "ImageClassificationConfig": { + "fields": { + "annotationSpecSet": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowMultiLabel": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "answerAggregationType": { + "type": "StringAggregationType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BoundingPolyConfig": { + "fields": { + "annotationSpecSet": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instructionMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PolylineConfig": { + "fields": { + "annotationSpecSet": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instructionMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SegmentationConfig": { + "fields": { + "annotationSpecSet": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instructionMessage": { + "type": "string", + "id": 2 + } + } + }, + "VideoClassificationConfig": { + "fields": { + "annotationSpecSetConfigs": { + "rule": "repeated", + "type": "AnnotationSpecSetConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "applyShotDetection": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AnnotationSpecSetConfig": { + "fields": { + "annotationSpecSet": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowMultiLabel": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ObjectDetectionConfig": { + "fields": { + "annotationSpecSet": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "extractionFrameRate": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ObjectTrackingConfig": { + "fields": { + "annotationSpecSet": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "EventConfig": { + "fields": { + "annotationSpecSets": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TextClassificationConfig": { + "fields": { + "allowMultiLabel": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "annotationSpecSet": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sentimentConfig": { + "type": "SentimentConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SentimentConfig": { + "fields": { + "enableLabelSentimentSelection": { + "type": "bool", + "id": 1 + } + } + }, + "TextEntityExtractionConfig": { + "fields": { + "annotationSpecSet": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Evaluation": { + "options": { + "(google.api.resource).type": "datalabeling.googleapis.com/Evaluation", + "(google.api.resource).pattern": "projects/{project}/datasets/{dataset}/evaluations/{evaluation}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "config": { + "type": "EvaluationConfig", + "id": 2 + }, + "evaluationJobRunTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "evaluationMetrics": { + "type": "EvaluationMetrics", + "id": 5 + }, + "annotationType": { + "type": "AnnotationType", + "id": 6 + }, + "evaluatedItemCount": { + "type": "int64", + "id": 7 + } + } + }, + "EvaluationConfig": { + "oneofs": { + "verticalOption": { + "oneof": [ + "boundingBoxEvaluationOptions" + ] + } + }, + "fields": { + "boundingBoxEvaluationOptions": { + "type": "BoundingBoxEvaluationOptions", + "id": 1 + } + } + }, + "BoundingBoxEvaluationOptions": { + "fields": { + "iouThreshold": { + "type": "float", + "id": 1 + } + } + }, + "EvaluationMetrics": { + "oneofs": { + "metrics": { + "oneof": [ + "classificationMetrics", + "objectDetectionMetrics" + ] + } + }, + "fields": { + "classificationMetrics": { + "type": "ClassificationMetrics", + "id": 1 + }, + "objectDetectionMetrics": { + "type": "ObjectDetectionMetrics", + "id": 2 + } + } + }, + "ClassificationMetrics": { + "fields": { + "prCurve": { + "type": "PrCurve", + "id": 1 + }, + "confusionMatrix": { + "type": "ConfusionMatrix", + "id": 2 + } + } + }, + "ObjectDetectionMetrics": { + "fields": { + "prCurve": { + "type": "PrCurve", + "id": 1 + } + } + }, + "PrCurve": { + "fields": { + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + }, + "areaUnderCurve": { + "type": "float", + "id": 2 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + }, + "meanAveragePrecision": { + "type": "float", + "id": 4 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "f1Score": { + "type": "float", + "id": 4 + }, + "recallAt1": { + "type": "float", + "id": 5 + }, + "precisionAt1": { + "type": "float", + "id": 6 + }, + "f1ScoreAt1": { + "type": "float", + "id": 7 + }, + "recallAt5": { + "type": "float", + "id": 8 + }, + "precisionAt5": { + "type": "float", + "id": 9 + }, + "f1ScoreAt5": { + "type": "float", + "id": 10 + } + } + } + } + }, + "ConfusionMatrix": { + "fields": { + "row": { + "rule": "repeated", + "type": "Row", + "id": 1 + } + }, + "nested": { + "ConfusionMatrixEntry": { + "fields": { + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + }, + "itemCount": { + "type": "int32", + "id": 2 + } + } + }, + "Row": { + "fields": { + "annotationSpec": { + "type": "AnnotationSpec", + "id": 1 + }, + "entries": { + "rule": "repeated", + "type": "ConfusionMatrixEntry", + "id": 2 + } + } + } + } + }, + "EvaluationJob": { + "options": { + "(google.api.resource).type": "datalabeling.googleapis.com/EvaluationJob", + "(google.api.resource).pattern": "projects/{project}/evaluationJobs/{evaluation_job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "state": { + "type": "State", + "id": 3 + }, + "schedule": { + "type": "string", + "id": 4 + }, + "modelVersion": { + "type": "string", + "id": 5 + }, + "evaluationJobConfig": { + "type": "EvaluationJobConfig", + "id": 6 + }, + "annotationSpecSet": { + "type": "string", + "id": 7 + }, + "labelMissingGroundTruth": { + "type": "bool", + "id": 8 + }, + "attempts": { + "rule": "repeated", + "type": "Attempt", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "SCHEDULED": 1, + "RUNNING": 2, + "PAUSED": 3, + "STOPPED": 4 + } + } + } + }, + "EvaluationJobConfig": { + "oneofs": { + "humanAnnotationRequestConfig": { + "oneof": [ + "imageClassificationConfig", + "boundingPolyConfig", + "textClassificationConfig" + ] + } + }, + "fields": { + "imageClassificationConfig": { + "type": "ImageClassificationConfig", + "id": 4 + }, + "boundingPolyConfig": { + "type": "BoundingPolyConfig", + "id": 5 + }, + "textClassificationConfig": { + "type": "TextClassificationConfig", + "id": 8 + }, + "inputConfig": { + "type": "InputConfig", + "id": 1 + }, + "evaluationConfig": { + "type": "EvaluationConfig", + "id": 2 + }, + "humanAnnotationConfig": { + "type": "HumanAnnotationConfig", + "id": 3 + }, + "bigqueryImportKeys": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "exampleCount": { + "type": "int32", + "id": 10 + }, + "exampleSamplePercentage": { + "type": "double", + "id": 11 + }, + "evaluationJobAlertConfig": { + "type": "EvaluationJobAlertConfig", + "id": 13 + } + } + }, + "EvaluationJobAlertConfig": { + "fields": { + "email": { + "type": "string", + "id": 1 + }, + "minAcceptableMeanAveragePrecision": { + "type": "double", + "id": 2 + } + } + }, + "Attempt": { + "fields": { + "attemptTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "Instruction": { + "options": { + "(google.api.resource).type": "datalabeling.googleapis.com/Instruction", + "(google.api.resource).pattern": "projects/{project}/instructions/{instruction}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "dataType": { + "type": "DataType", + "id": 6 + }, + "csvInstruction": { + "type": "CsvInstruction", + "id": 7, + "options": { + "deprecated": true + } + }, + "pdfInstruction": { + "type": "PdfInstruction", + "id": 9 + }, + "blockingResources": { + "rule": "repeated", + "type": "string", + "id": 10 + } + } + }, + "CsvInstruction": { + "fields": { + "gcsFileUri": { + "type": "string", + "id": 1 + } + } + }, + "PdfInstruction": { + "fields": { + "gcsFileUri": { + "type": "string", + "id": 1 + } + } + }, + "ImportDataOperationResponse": { + "fields": { + "dataset": { + "type": "string", + "id": 1 + }, + "totalCount": { + "type": "int32", + "id": 2 + }, + "importCount": { + "type": "int32", + "id": 3 + } + } + }, + "ExportDataOperationResponse": { + "fields": { + "dataset": { + "type": "string", + "id": 1 + }, + "totalCount": { + "type": "int32", + "id": 2 + }, + "exportCount": { + "type": "int32", + "id": 3 + }, + "labelStats": { + "type": "LabelStats", + "id": 4 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 5 + } + } + }, + "ImportDataOperationMetadata": { + "fields": { + "dataset": { + "type": "string", + "id": 1 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "ExportDataOperationMetadata": { + "fields": { + "dataset": { + "type": "string", + "id": 1 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "LabelOperationMetadata": { + "oneofs": { + "details": { + "oneof": [ + "imageClassificationDetails", + "imageBoundingBoxDetails", + "imageBoundingPolyDetails", + "imageOrientedBoundingBoxDetails", + "imagePolylineDetails", + "imageSegmentationDetails", + "videoClassificationDetails", + "videoObjectDetectionDetails", + "videoObjectTrackingDetails", + "videoEventDetails", + "textClassificationDetails", + "textEntityExtractionDetails" + ] + } + }, + "fields": { + "imageClassificationDetails": { + "type": "LabelImageClassificationOperationMetadata", + "id": 3 + }, + "imageBoundingBoxDetails": { + "type": "LabelImageBoundingBoxOperationMetadata", + "id": 4 + }, + "imageBoundingPolyDetails": { + "type": "LabelImageBoundingPolyOperationMetadata", + "id": 11 + }, + "imageOrientedBoundingBoxDetails": { + "type": "LabelImageOrientedBoundingBoxOperationMetadata", + "id": 14 + }, + "imagePolylineDetails": { + "type": "LabelImagePolylineOperationMetadata", + "id": 12 + }, + "imageSegmentationDetails": { + "type": "LabelImageSegmentationOperationMetadata", + "id": 15 + }, + "videoClassificationDetails": { + "type": "LabelVideoClassificationOperationMetadata", + "id": 5 + }, + "videoObjectDetectionDetails": { + "type": "LabelVideoObjectDetectionOperationMetadata", + "id": 6 + }, + "videoObjectTrackingDetails": { + "type": "LabelVideoObjectTrackingOperationMetadata", + "id": 7 + }, + "videoEventDetails": { + "type": "LabelVideoEventOperationMetadata", + "id": 8 + }, + "textClassificationDetails": { + "type": "LabelTextClassificationOperationMetadata", + "id": 9 + }, + "textEntityExtractionDetails": { + "type": "LabelTextEntityExtractionOperationMetadata", + "id": 13 + }, + "progressPercent": { + "type": "int32", + "id": 1 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 16 + } + } + }, + "LabelImageClassificationOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelImageBoundingBoxOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelImageOrientedBoundingBoxOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelImageBoundingPolyOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelImagePolylineOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelImageSegmentationOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelVideoClassificationOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelVideoObjectDetectionOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelVideoObjectTrackingOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelVideoEventOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelTextClassificationOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "LabelTextEntityExtractionOperationMetadata": { + "fields": { + "basicConfig": { + "type": "HumanAnnotationConfig", + "id": 1 + } + } + }, + "CreateInstructionMetadata": { + "fields": { + "instruction": { + "type": "string", + "id": 1 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "cc_enable_arenas": true, + "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" + }, + "nested": { + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "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 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-datalabeling/samples/.eslintrc.yml b/packages/google-cloud-datalabeling/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-datalabeling/samples/README.md b/packages/google-cloud-datalabeling/samples/README.md new file mode 100644 index 00000000000..1ca6e8a5bd9 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/README.md @@ -0,0 +1,682 @@ +[//]: # "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 Data Labeling: 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) + * [Data_labeling_service.create_annotation_spec_set](#data_labeling_service.create_annotation_spec_set) + * [Data_labeling_service.create_dataset](#data_labeling_service.create_dataset) + * [Data_labeling_service.create_evaluation_job](#data_labeling_service.create_evaluation_job) + * [Data_labeling_service.create_instruction](#data_labeling_service.create_instruction) + * [Data_labeling_service.delete_annotated_dataset](#data_labeling_service.delete_annotated_dataset) + * [Data_labeling_service.delete_annotation_spec_set](#data_labeling_service.delete_annotation_spec_set) + * [Data_labeling_service.delete_dataset](#data_labeling_service.delete_dataset) + * [Data_labeling_service.delete_evaluation_job](#data_labeling_service.delete_evaluation_job) + * [Data_labeling_service.delete_instruction](#data_labeling_service.delete_instruction) + * [Data_labeling_service.export_data](#data_labeling_service.export_data) + * [Data_labeling_service.get_annotated_dataset](#data_labeling_service.get_annotated_dataset) + * [Data_labeling_service.get_annotation_spec_set](#data_labeling_service.get_annotation_spec_set) + * [Data_labeling_service.get_data_item](#data_labeling_service.get_data_item) + * [Data_labeling_service.get_dataset](#data_labeling_service.get_dataset) + * [Data_labeling_service.get_evaluation](#data_labeling_service.get_evaluation) + * [Data_labeling_service.get_evaluation_job](#data_labeling_service.get_evaluation_job) + * [Data_labeling_service.get_example](#data_labeling_service.get_example) + * [Data_labeling_service.get_instruction](#data_labeling_service.get_instruction) + * [Data_labeling_service.import_data](#data_labeling_service.import_data) + * [Data_labeling_service.label_image](#data_labeling_service.label_image) + * [Data_labeling_service.label_text](#data_labeling_service.label_text) + * [Data_labeling_service.label_video](#data_labeling_service.label_video) + * [Data_labeling_service.list_annotated_datasets](#data_labeling_service.list_annotated_datasets) + * [Data_labeling_service.list_annotation_spec_sets](#data_labeling_service.list_annotation_spec_sets) + * [Data_labeling_service.list_data_items](#data_labeling_service.list_data_items) + * [Data_labeling_service.list_datasets](#data_labeling_service.list_datasets) + * [Data_labeling_service.list_evaluation_jobs](#data_labeling_service.list_evaluation_jobs) + * [Data_labeling_service.list_examples](#data_labeling_service.list_examples) + * [Data_labeling_service.list_instructions](#data_labeling_service.list_instructions) + * [Data_labeling_service.pause_evaluation_job](#data_labeling_service.pause_evaluation_job) + * [Data_labeling_service.resume_evaluation_job](#data_labeling_service.resume_evaluation_job) + * [Data_labeling_service.search_evaluations](#data_labeling_service.search_evaluations) + * [Data_labeling_service.search_example_comparisons](#data_labeling_service.search_example_comparisons) + * [Data_labeling_service.update_evaluation_job](#data_labeling_service.update_evaluation_job) + * [Get Datasets](#get-datasets) + * [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 + + + +### Data_labeling_service.create_annotation_spec_set + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_annotation_spec_set.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-datalabeling/samples/generated/v1beta1/data_labeling_service.create_annotation_spec_set.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_annotation_spec_set.js` + + +----- + + + + +### Data_labeling_service.create_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.create_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_dataset.js` + + +----- + + + + +### Data_labeling_service.create_evaluation_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.create_evaluation_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_evaluation_job.js` + + +----- + + + + +### Data_labeling_service.create_instruction + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_instruction.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-datalabeling/samples/generated/v1beta1/data_labeling_service.create_instruction.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_instruction.js` + + +----- + + + + +### Data_labeling_service.delete_annotated_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotated_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotated_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotated_dataset.js` + + +----- + + + + +### Data_labeling_service.delete_annotation_spec_set + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotation_spec_set.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotation_spec_set.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotation_spec_set.js` + + +----- + + + + +### Data_labeling_service.delete_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_dataset.js` + + +----- + + + + +### Data_labeling_service.delete_evaluation_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_evaluation_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_evaluation_job.js` + + +----- + + + + +### Data_labeling_service.delete_instruction + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_instruction.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-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_instruction.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_instruction.js` + + +----- + + + + +### Data_labeling_service.export_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.export_data.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-datalabeling/samples/generated/v1beta1/data_labeling_service.export_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.export_data.js` + + +----- + + + + +### Data_labeling_service.get_annotated_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotated_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotated_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotated_dataset.js` + + +----- + + + + +### Data_labeling_service.get_annotation_spec_set + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotation_spec_set.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotation_spec_set.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotation_spec_set.js` + + +----- + + + + +### Data_labeling_service.get_data_item + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_data_item.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_data_item.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_data_item.js` + + +----- + + + + +### Data_labeling_service.get_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_dataset.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_dataset.js` + + +----- + + + + +### Data_labeling_service.get_evaluation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation.js` + + +----- + + + + +### Data_labeling_service.get_evaluation_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation_job.js` + + +----- + + + + +### Data_labeling_service.get_example + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_example.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_example.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_example.js` + + +----- + + + + +### Data_labeling_service.get_instruction + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_instruction.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-datalabeling/samples/generated/v1beta1/data_labeling_service.get_instruction.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_instruction.js` + + +----- + + + + +### Data_labeling_service.import_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.import_data.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-datalabeling/samples/generated/v1beta1/data_labeling_service.import_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.import_data.js` + + +----- + + + + +### Data_labeling_service.label_image + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_image.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-datalabeling/samples/generated/v1beta1/data_labeling_service.label_image.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_image.js` + + +----- + + + + +### Data_labeling_service.label_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_text.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-datalabeling/samples/generated/v1beta1/data_labeling_service.label_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_text.js` + + +----- + + + + +### Data_labeling_service.label_video + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_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-datalabeling/samples/generated/v1beta1/data_labeling_service.label_video.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_video.js` + + +----- + + + + +### Data_labeling_service.list_annotated_datasets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotated_datasets.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotated_datasets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotated_datasets.js` + + +----- + + + + +### Data_labeling_service.list_annotation_spec_sets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotation_spec_sets.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotation_spec_sets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotation_spec_sets.js` + + +----- + + + + +### Data_labeling_service.list_data_items + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_data_items.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_data_items.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_data_items.js` + + +----- + + + + +### Data_labeling_service.list_datasets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_datasets.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_datasets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_datasets.js` + + +----- + + + + +### Data_labeling_service.list_evaluation_jobs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_evaluation_jobs.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_evaluation_jobs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_evaluation_jobs.js` + + +----- + + + + +### Data_labeling_service.list_examples + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_examples.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_examples.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_examples.js` + + +----- + + + + +### Data_labeling_service.list_instructions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_instructions.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-datalabeling/samples/generated/v1beta1/data_labeling_service.list_instructions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_instructions.js` + + +----- + + + + +### Data_labeling_service.pause_evaluation_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.pause_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.pause_evaluation_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.pause_evaluation_job.js` + + +----- + + + + +### Data_labeling_service.resume_evaluation_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.resume_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.resume_evaluation_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.resume_evaluation_job.js` + + +----- + + + + +### Data_labeling_service.search_evaluations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_evaluations.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-datalabeling/samples/generated/v1beta1/data_labeling_service.search_evaluations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_evaluations.js` + + +----- + + + + +### Data_labeling_service.search_example_comparisons + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_example_comparisons.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-datalabeling/samples/generated/v1beta1/data_labeling_service.search_example_comparisons.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_example_comparisons.js` + + +----- + + + + +### Data_labeling_service.update_evaluation_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.update_evaluation_job.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-datalabeling/samples/generated/v1beta1/data_labeling_service.update_evaluation_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.update_evaluation_job.js` + + +----- + + + + +### Get Datasets + +Gets all available Datasets. + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/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-datalabeling/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node quickstart.js` + + +----- + + + + +### Quickstart.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datalabeling/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-datalabeling/samples/test/quickstart.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-datalabeling/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/data-labeling/docs/ diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_annotation_spec_set.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_annotation_spec_set.js new file mode 100644 index 00000000000..a2e981cff53 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_annotation_spec_set.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, annotationSpecSet) { + // [START datalabeling_v1beta1_generated_DataLabelingService_CreateAnnotationSpecSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. AnnotationSpecSet resource parent, format: + * projects/{project_id} + */ + // const parent = 'abc123' + /** + * Required. Annotation spec set to create. Annotation specs must be included. + * Only one annotation spec will be accepted for annotation specs with same + * display_name. + */ + // const annotationSpecSet = {} + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callCreateAnnotationSpecSet() { + // Construct request + const request = { + parent, + annotationSpecSet, + }; + + // Run request + const response = await datalabelingClient.createAnnotationSpecSet(request); + console.log(response); + } + + callCreateAnnotationSpecSet(); + // [END datalabeling_v1beta1_generated_DataLabelingService_CreateAnnotationSpecSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_dataset.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_dataset.js new file mode 100644 index 00000000000..21f7d7986e4 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_dataset.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, dataset) { + // [START datalabeling_v1beta1_generated_DataLabelingService_CreateDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Dataset resource parent, format: + * projects/{project_id} + */ + // const parent = 'abc123' + /** + * Required. The dataset to be created. + */ + // const dataset = {} + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callCreateDataset() { + // Construct request + const request = { + parent, + dataset, + }; + + // Run request + const response = await datalabelingClient.createDataset(request); + console.log(response); + } + + callCreateDataset(); + // [END datalabeling_v1beta1_generated_DataLabelingService_CreateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_evaluation_job.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_evaluation_job.js new file mode 100644 index 00000000000..6ca13cd63a0 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_evaluation_job.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, job) { + // [START datalabeling_v1beta1_generated_DataLabelingService_CreateEvaluationJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Evaluation job resource parent. Format: + * "projects/{project_id}" + */ + // const parent = 'abc123' + /** + * Required. The evaluation job to create. + */ + // const job = {} + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callCreateEvaluationJob() { + // Construct request + const request = { + parent, + job, + }; + + // Run request + const response = await datalabelingClient.createEvaluationJob(request); + console.log(response); + } + + callCreateEvaluationJob(); + // [END datalabeling_v1beta1_generated_DataLabelingService_CreateEvaluationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_instruction.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_instruction.js new file mode 100644 index 00000000000..3b021c9d91f --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.create_instruction.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instruction) { + // [START datalabeling_v1beta1_generated_DataLabelingService_CreateInstruction_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Instruction resource parent, format: + * projects/{project_id} + */ + // const parent = 'abc123' + /** + * Required. Instruction of how to perform the labeling task. + */ + // const instruction = {} + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callCreateInstruction() { + // Construct request + const request = { + parent, + instruction, + }; + + // Run request + const [operation] = await datalabelingClient.createInstruction(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstruction(); + // [END datalabeling_v1beta1_generated_DataLabelingService_CreateInstruction_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotated_dataset.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotated_dataset.js new file mode 100644 index 00000000000..de0c67300b8 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotated_dataset.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotatedDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the annotated dataset to delete, format: + * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + * {annotated_dataset_id} + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callDeleteAnnotatedDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.deleteAnnotatedDataset(request); + console.log(response); + } + + callDeleteAnnotatedDataset(); + // [END datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotatedDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotation_spec_set.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotation_spec_set.js new file mode 100644 index 00000000000..cb8aa9c920b --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_annotation_spec_set.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotationSpecSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. AnnotationSpec resource name, format: + * `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callDeleteAnnotationSpecSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.deleteAnnotationSpecSet(request); + console.log(response); + } + + callDeleteAnnotationSpecSet(); + // [END datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotationSpecSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_dataset.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_dataset.js new file mode 100644 index 00000000000..6ca2a05008a --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_dataset.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_DeleteDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Dataset resource name, format: + * projects/{project_id}/datasets/{dataset_id} + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callDeleteDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.deleteDataset(request); + console.log(response); + } + + callDeleteDataset(); + // [END datalabeling_v1beta1_generated_DataLabelingService_DeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_evaluation_job.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_evaluation_job.js new file mode 100644 index 00000000000..90e9779a726 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_evaluation_job.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_DeleteEvaluationJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the evaluation job that is going to be deleted. Format: + * "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callDeleteEvaluationJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.deleteEvaluationJob(request); + console.log(response); + } + + callDeleteEvaluationJob(); + // [END datalabeling_v1beta1_generated_DataLabelingService_DeleteEvaluationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_instruction.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_instruction.js new file mode 100644 index 00000000000..4d8125bae1f --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.delete_instruction.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_DeleteInstruction_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Instruction resource name, format: + * projects/{project_id}/instructions/{instruction_id} + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callDeleteInstruction() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.deleteInstruction(request); + console.log(response); + } + + callDeleteInstruction(); + // [END datalabeling_v1beta1_generated_DataLabelingService_DeleteInstruction_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.export_data.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.export_data.js new file mode 100644 index 00000000000..81828d21a10 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.export_data.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, annotatedDataset, outputConfig) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ExportData_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Dataset resource name, format: + * projects/{project_id}/datasets/{dataset_id} + */ + // const name = 'abc123' + /** + * Required. Annotated dataset resource name. DataItem in + * Dataset and their annotations in specified annotated dataset will be + * exported. It's in format of + * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + * {annotated_dataset_id} + */ + // const annotatedDataset = 'abc123' + /** + * Optional. Filter is not supported at this moment. + */ + // const filter = 'abc123' + /** + * Required. Specify the output destination. + */ + // const outputConfig = {} + /** + * Email of the user who started the export task and should be notified by + * email. If empty no notification will be sent. + */ + // const userEmailAddress = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callExportData() { + // Construct request + const request = { + name, + annotatedDataset, + outputConfig, + }; + + // Run request + const [operation] = await datalabelingClient.exportData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportData(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ExportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotated_dataset.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotated_dataset.js new file mode 100644 index 00000000000..74f778a103f --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotated_dataset.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_GetAnnotatedDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the annotated dataset to get, format: + * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + * {annotated_dataset_id} + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callGetAnnotatedDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.getAnnotatedDataset(request); + console.log(response); + } + + callGetAnnotatedDataset(); + // [END datalabeling_v1beta1_generated_DataLabelingService_GetAnnotatedDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotation_spec_set.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotation_spec_set.js new file mode 100644 index 00000000000..cafb4008430 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_annotation_spec_set.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_GetAnnotationSpecSet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. AnnotationSpecSet resource name, format: + * projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callGetAnnotationSpecSet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.getAnnotationSpecSet(request); + console.log(response); + } + + callGetAnnotationSpecSet(); + // [END datalabeling_v1beta1_generated_DataLabelingService_GetAnnotationSpecSet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_data_item.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_data_item.js new file mode 100644 index 00000000000..54b2d1226c8 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_data_item.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_GetDataItem_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the data item to get, format: + * projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callGetDataItem() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.getDataItem(request); + console.log(response); + } + + callGetDataItem(); + // [END datalabeling_v1beta1_generated_DataLabelingService_GetDataItem_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_dataset.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_dataset.js new file mode 100644 index 00000000000..6e4a53d05fd --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_dataset.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_GetDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Dataset resource name, format: + * projects/{project_id}/datasets/{dataset_id} + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callGetDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.getDataset(request); + console.log(response); + } + + callGetDataset(); + // [END datalabeling_v1beta1_generated_DataLabelingService_GetDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation.js new file mode 100644 index 00000000000..1193a6b8ce8 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_GetEvaluation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the evaluation. Format: + * "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}' + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callGetEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.getEvaluation(request); + console.log(response); + } + + callGetEvaluation(); + // [END datalabeling_v1beta1_generated_DataLabelingService_GetEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation_job.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation_job.js new file mode 100644 index 00000000000..29ed567c6c8 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_evaluation_job.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_GetEvaluationJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the evaluation job. Format: + * "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callGetEvaluationJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.getEvaluationJob(request); + console.log(response); + } + + callGetEvaluationJob(); + // [END datalabeling_v1beta1_generated_DataLabelingService_GetEvaluationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_example.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_example.js new file mode 100644 index 00000000000..52d4af3987a --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_example.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_GetExample_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of example, format: + * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + * {annotated_dataset_id}/examples/{example_id} + */ + // const name = 'abc123' + /** + * Optional. An expression for filtering Examples. Filter by + * annotation_spec.display_name is supported. Format + * "annotation_spec.display_name = {display_name}" + */ + // const filter = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callGetExample() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.getExample(request); + console.log(response); + } + + callGetExample(); + // [END datalabeling_v1beta1_generated_DataLabelingService_GetExample_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_instruction.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_instruction.js new file mode 100644 index 00000000000..4993b4528e1 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.get_instruction.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_GetInstruction_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Instruction resource name, format: + * projects/{project_id}/instructions/{instruction_id} + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callGetInstruction() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.getInstruction(request); + console.log(response); + } + + callGetInstruction(); + // [END datalabeling_v1beta1_generated_DataLabelingService_GetInstruction_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.import_data.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.import_data.js new file mode 100644 index 00000000000..37cc864316e --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.import_data.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, inputConfig) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ImportData_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Dataset resource name, format: + * projects/{project_id}/datasets/{dataset_id} + */ + // const name = 'abc123' + /** + * Required. Specify the input source of the data. + */ + // const inputConfig = {} + /** + * Email of the user who started the import task and should be notified by + * email. If empty no notification will be sent. + */ + // const userEmailAddress = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callImportData() { + // Construct request + const request = { + name, + inputConfig, + }; + + // Run request + const [operation] = await datalabelingClient.importData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportData(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ImportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_image.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_image.js new file mode 100644 index 00000000000..71b77e7cd27 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_image.js @@ -0,0 +1,97 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, basicConfig, feature) { + // [START datalabeling_v1beta1_generated_DataLabelingService_LabelImage_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. + */ + /** + * Configuration for image classification task. + * One of image_classification_config, bounding_poly_config, + * polyline_config and segmentation_config are required. + */ + // const imageClassificationConfig = {} + /** + * Configuration for bounding box and bounding poly task. + * One of image_classification_config, bounding_poly_config, + * polyline_config and segmentation_config are required. + */ + // const boundingPolyConfig = {} + /** + * Configuration for polyline task. + * One of image_classification_config, bounding_poly_config, + * polyline_config and segmentation_config are required. + */ + // const polylineConfig = {} + /** + * Configuration for segmentation task. + * One of image_classification_config, bounding_poly_config, + * polyline_config and segmentation_config are required. + */ + // const segmentationConfig = {} + /** + * Required. Name of the dataset to request labeling task, format: + * projects/{project_id}/datasets/{dataset_id} + */ + // const parent = 'abc123' + /** + * Required. Basic human annotation config. + */ + // const basicConfig = {} + /** + * Required. The type of image labeling task. + */ + // const feature = {} + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callLabelImage() { + // Construct request + const request = { + parent, + basicConfig, + feature, + }; + + // Run request + const [operation] = await datalabelingClient.labelImage(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLabelImage(); + // [END datalabeling_v1beta1_generated_DataLabelingService_LabelImage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_text.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_text.js new file mode 100644 index 00000000000..a2339ca3b62 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_text.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, basicConfig, feature) { + // [START datalabeling_v1beta1_generated_DataLabelingService_LabelText_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. + */ + /** + * Configuration for text classification task. + * One of text_classification_config and text_entity_extraction_config + * is required. + */ + // const textClassificationConfig = {} + /** + * Configuration for entity extraction task. + * One of text_classification_config and text_entity_extraction_config + * is required. + */ + // const textEntityExtractionConfig = {} + /** + * Required. Name of the data set to request labeling task, format: + * projects/{project_id}/datasets/{dataset_id} + */ + // const parent = 'abc123' + /** + * Required. Basic human annotation config. + */ + // const basicConfig = {} + /** + * Required. The type of text labeling task. + */ + // const feature = {} + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callLabelText() { + // Construct request + const request = { + parent, + basicConfig, + feature, + }; + + // Run request + const [operation] = await datalabelingClient.labelText(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLabelText(); + // [END datalabeling_v1beta1_generated_DataLabelingService_LabelText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_video.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_video.js new file mode 100644 index 00000000000..e90836a3b6b --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.label_video.js @@ -0,0 +1,97 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, basicConfig, feature) { + // [START datalabeling_v1beta1_generated_DataLabelingService_LabelVideo_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. + */ + /** + * Configuration for video classification task. + * One of video_classification_config, object_detection_config, + * object_tracking_config and event_config is required. + */ + // const videoClassificationConfig = {} + /** + * Configuration for video object detection task. + * One of video_classification_config, object_detection_config, + * object_tracking_config and event_config is required. + */ + // const objectDetectionConfig = {} + /** + * Configuration for video object tracking task. + * One of video_classification_config, object_detection_config, + * object_tracking_config and event_config is required. + */ + // const objectTrackingConfig = {} + /** + * Configuration for video event task. + * One of video_classification_config, object_detection_config, + * object_tracking_config and event_config is required. + */ + // const eventConfig = {} + /** + * Required. Name of the dataset to request labeling task, format: + * projects/{project_id}/datasets/{dataset_id} + */ + // const parent = 'abc123' + /** + * Required. Basic human annotation config. + */ + // const basicConfig = {} + /** + * Required. The type of video labeling task. + */ + // const feature = {} + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callLabelVideo() { + // Construct request + const request = { + parent, + basicConfig, + feature, + }; + + // Run request + const [operation] = await datalabelingClient.labelVideo(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLabelVideo(); + // [END datalabeling_v1beta1_generated_DataLabelingService_LabelVideo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotated_datasets.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotated_datasets.js new file mode 100644 index 00000000000..b4c7df757b5 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotated_datasets.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ListAnnotatedDatasets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the dataset to list annotated datasets, format: + * projects/{project_id}/datasets/{dataset_id} + */ + // const parent = 'abc123' + /** + * Optional. Filter is not supported at this moment. + */ + // const filter = 'abc123' + /** + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * ListAnnotatedDatasetsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token of the previous + * DataLabelingService.ListAnnotatedDatasets call. + * Return first page if empty. + */ + // const pageToken = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callListAnnotatedDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datalabelingClient.listAnnotatedDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAnnotatedDatasets(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ListAnnotatedDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotation_spec_sets.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotation_spec_sets.js new file mode 100644 index 00000000000..7b9c0b0ee15 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_annotation_spec_sets.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ListAnnotationSpecSets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent of AnnotationSpecSet resource, format: + * projects/{project_id} + */ + // const parent = 'abc123' + /** + * Optional. Filter is not supported at this moment. + */ + // const filter = 'abc123' + /** + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * ListAnnotationSpecSetsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token of the previous + * DataLabelingService.ListAnnotationSpecSets call. + * Return first page if empty. + */ + // const pageToken = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callListAnnotationSpecSets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datalabelingClient.listAnnotationSpecSetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAnnotationSpecSets(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ListAnnotationSpecSets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_data_items.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_data_items.js new file mode 100644 index 00000000000..47f7477716f --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_data_items.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ListDataItems_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the dataset to list data items, format: + * projects/{project_id}/datasets/{dataset_id} + */ + // const parent = 'abc123' + /** + * Optional. Filter is not supported at this moment. + */ + // const filter = 'abc123' + /** + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * ListDataItemsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token of the previous + * DataLabelingService.ListDataItems call. + * Return first page if empty. + */ + // const pageToken = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callListDataItems() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datalabelingClient.listDataItemsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataItems(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ListDataItems_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_datasets.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_datasets.js new file mode 100644 index 00000000000..2c5c988fa8d --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_datasets.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ListDatasets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Dataset resource parent, format: + * projects/{project_id} + */ + // const parent = 'abc123' + /** + * Optional. Filter on dataset is not supported at this moment. + */ + // const filter = 'abc123' + /** + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * ListDatasetsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token of the previous + * DataLabelingService.ListDatasets call. + * Returns the first page if empty. + */ + // const pageToken = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callListDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datalabelingClient.listDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatasets(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ListDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_evaluation_jobs.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_evaluation_jobs.js new file mode 100644 index 00000000000..9bfa382ca99 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_evaluation_jobs.js @@ -0,0 +1,88 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ListEvaluationJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Evaluation job resource parent. Format: + * "projects/{project_id}" + */ + // const parent = 'abc123' + /** + * Optional. You can filter the jobs to list by model_id (also known as + * model_name, as described in + * EvaluationJob.modelVersion google.cloud.datalabeling.v1beta1.EvaluationJob.model_version) or by + * evaluation job state (as described in EvaluationJob.state google.cloud.datalabeling.v1beta1.EvaluationJob.state). To filter + * by both criteria, use the `AND` operator or the `OR` operator. For example, + * you can use the following string for your filter: + * "evaluation_job.model_id = {model_name} AND + * evaluation_job.state = {evaluation_job_state}" + */ + // const filter = 'abc123' + /** + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * nextPageToken google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.next_page_token in the response + * to the previous request. The request returns the first page if this is + * empty. + */ + // const pageToken = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callListEvaluationJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datalabelingClient.listEvaluationJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvaluationJobs(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ListEvaluationJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_examples.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_examples.js new file mode 100644 index 00000000000..7ab56bfa5d3 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_examples.js @@ -0,0 +1,83 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ListExamples_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Example resource parent. + */ + // const parent = 'abc123' + /** + * Optional. An expression for filtering Examples. For annotated datasets that + * have annotation spec set, filter by + * annotation_spec.display_name is supported. Format + * "annotation_spec.display_name = {display_name}" + */ + // const filter = 'abc123' + /** + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * ListExamplesResponse.next_page_token google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token of the previous + * DataLabelingService.ListExamples call. + * Return first page if empty. + */ + // const pageToken = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callListExamples() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datalabelingClient.listExamplesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExamples(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ListExamples_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_instructions.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_instructions.js new file mode 100644 index 00000000000..b9b04b36fc5 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.list_instructions.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ListInstructions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Instruction resource parent, format: + * projects/{project_id} + */ + // const parent = 'abc123' + /** + * Optional. Filter is not supported at this moment. + */ + // const filter = 'abc123' + /** + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * ListInstructionsResponse.next_page_token google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token of the previous + * DataLabelingService.ListInstructions call. + * Return first page if empty. + */ + // const pageToken = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callListInstructions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datalabelingClient.listInstructionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstructions(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ListInstructions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.pause_evaluation_job.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.pause_evaluation_job.js new file mode 100644 index 00000000000..221ef0bf0e0 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.pause_evaluation_job.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_PauseEvaluationJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the evaluation job that is going to be paused. Format: + * "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callPauseEvaluationJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.pauseEvaluationJob(request); + console.log(response); + } + + callPauseEvaluationJob(); + // [END datalabeling_v1beta1_generated_DataLabelingService_PauseEvaluationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.resume_evaluation_job.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.resume_evaluation_job.js new file mode 100644 index 00000000000..43804d1a07f --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.resume_evaluation_job.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datalabeling_v1beta1_generated_DataLabelingService_ResumeEvaluationJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the evaluation job that is going to be resumed. Format: + * "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + */ + // const name = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callResumeEvaluationJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datalabelingClient.resumeEvaluationJob(request); + console.log(response); + } + + callResumeEvaluationJob(); + // [END datalabeling_v1beta1_generated_DataLabelingService_ResumeEvaluationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_evaluations.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_evaluations.js new file mode 100644 index 00000000000..939131e6cb0 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_evaluations.js @@ -0,0 +1,109 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datalabeling_v1beta1_generated_DataLabelingService_SearchEvaluations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Evaluation search parent (project ID). Format: + * "projects/{project_id}" + */ + // const parent = 'abc123' + /** + * Optional. To search evaluations, you can filter by the following: + * * evaluation_job.evaluation_job_id (the last part of + * EvaluationJob.name google.cloud.datalabeling.v1beta1.EvaluationJob.name) + * * evaluation_job.model_id (the {model_name} portion + * of EvaluationJob.modelVersion google.cloud.datalabeling.v1beta1.EvaluationJob.model_version) + * * evaluation_job.evaluation_job_run_time_start (Minimum + * threshold for the + * evaluationJobRunTime google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time that created + * the evaluation) + * * evaluation_job.evaluation_job_run_time_end (Maximum + * threshold for the + * evaluationJobRunTime google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time that created + * the evaluation) + * * evaluation_job.job_state (EvaluationJob.state google.cloud.datalabeling.v1beta1.EvaluationJob.state) + * * annotation_spec.display_name (the Evaluation contains a + * metric for the annotation spec with this + * displayName google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name) + * To filter by multiple critiera, use the `AND` operator or the `OR` + * operator. The following examples shows a string that filters by several + * critiera: + * "evaluation_job.evaluation_job_id = + * {evaluation_job_id} AND evaluation_job.model_id = + * {model_name} AND + * evaluation_job.evaluation_job_run_time_start = + * {timestamp_1} AND + * evaluation_job.evaluation_job_run_time_end = + * {timestamp_2} AND annotation_spec.display_name = + * {display_name}" + */ + // const filter = 'abc123' + /** + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * nextPageToken google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.next_page_token of the response + * to a previous search request. + * If you don't specify this field, the API call requests the first page of + * the search. + */ + // const pageToken = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callSearchEvaluations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datalabelingClient.searchEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchEvaluations(); + // [END datalabeling_v1beta1_generated_DataLabelingService_SearchEvaluations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_example_comparisons.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_example_comparisons.js new file mode 100644 index 00000000000..97c92682903 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.search_example_comparisons.js @@ -0,0 +1,79 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datalabeling_v1beta1_generated_DataLabelingService_SearchExampleComparisons_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the Evaluation google.cloud.datalabeling.v1beta1.Evaluation resource to search for example + * comparisons from. Format: + * "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}" + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * nextPageToken SearchExampleComparisons.next_page_token of the response + * to a previous search rquest. + * If you don't specify this field, the API call requests the first page of + * the search. + */ + // const pageToken = 'abc123' + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callSearchExampleComparisons() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datalabelingClient.searchExampleComparisonsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchExampleComparisons(); + // [END datalabeling_v1beta1_generated_DataLabelingService_SearchExampleComparisons_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.update_evaluation_job.js b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.update_evaluation_job.js new file mode 100644 index 00000000000..1ab4be6d7e0 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/data_labeling_service.update_evaluation_job.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(evaluationJob) { + // [START datalabeling_v1beta1_generated_DataLabelingService_UpdateEvaluationJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Evaluation job that is going to be updated. + */ + // const evaluationJob = {} + /** + * Optional. Mask for which fields to update. You can only provide the + * following fields: + * * `evaluationJobConfig.humanAnnotationConfig.instruction` + * * `evaluationJobConfig.exampleCount` + * * `evaluationJobConfig.exampleSamplePercentage` + * You can provide more than one of these fields by separating them with + * commas. + */ + // const updateMask = {} + + // Imports the Datalabeling library + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling').v1beta1; + + // Instantiates a client + const datalabelingClient = new DataLabelingServiceClient(); + + async function callUpdateEvaluationJob() { + // Construct request + const request = { + evaluationJob, + }; + + // Run request + const response = await datalabelingClient.updateEvaluationJob(request); + console.log(response); + } + + callUpdateEvaluationJob(); + // [END datalabeling_v1beta1_generated_DataLabelingService_UpdateEvaluationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/generated/v1beta1/snippet_metadata.google.cloud.datalabeling.v1beta1.json b/packages/google-cloud-datalabeling/samples/generated/v1beta1/snippet_metadata.google.cloud.datalabeling.v1beta1.json new file mode 100644 index 00000000000..391b022e2b5 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/generated/v1beta1/snippet_metadata.google.cloud.datalabeling.v1beta1.json @@ -0,0 +1,1591 @@ +{ + "clientLibrary": { + "name": "nodejs-datalabeling", + "version": "3.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.datalabeling.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_CreateDataset_async", + "title": "datalabeling createDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates dataset. If success return a Dataset resource.", + "canonical": true, + "file": "data_labeling_service.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.datalabeling.v1beta1.Dataset" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.Dataset", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.CreateDataset", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_GetDataset_async", + "title": "datalabeling getDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets dataset by resource name.", + "canonical": true, + "file": "data_labeling_service.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.Dataset", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataset", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ListDatasets_async", + "title": "datalabeling listDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists datasets under a project. Pagination is supported.", + "canonical": true, + "file": "data_labeling_service.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListDatasets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.ListDatasetsResponse", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListDatasets", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_DeleteDataset_async", + "title": "datalabeling deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes a dataset by resource name.", + "canonical": true, + "file": "data_labeling_service.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteDataset", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ImportData_async", + "title": "datalabeling importData Sample", + "origin": "API_DEFINITION", + "description": " Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.", + "canonical": true, + "file": "data_labeling_service.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ImportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.datalabeling.v1beta1.InputConfig" + }, + { + "name": "user_email_address", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ImportData", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ExportData_async", + "title": "datalabeling exportData Sample", + "origin": "API_DEFINITION", + "description": " Exports data and annotations from dataset.", + "canonical": true, + "file": "data_labeling_service.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ExportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "annotated_dataset", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.datalabeling.v1beta1.OutputConfig" + }, + { + "name": "user_email_address", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ExportData", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_GetDataItem_async", + "title": "datalabeling getDataItem Sample", + "origin": "API_DEFINITION", + "description": " Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.", + "canonical": true, + "file": "data_labeling_service.get_data_item.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataItem", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataItem", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.DataItem", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "GetDataItem", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataItem", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ListDataItems_async", + "title": "datalabeling listDataItems Sample", + "origin": "API_DEFINITION", + "description": " Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.", + "canonical": true, + "file": "data_labeling_service.list_data_items.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataItems", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListDataItems", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.ListDataItemsResponse", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ListDataItems", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListDataItems", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_GetAnnotatedDataset_async", + "title": "datalabeling getAnnotatedDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotated dataset by resource name.", + "canonical": true, + "file": "data_labeling_service.get_annotated_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotatedDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotatedDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.AnnotatedDataset", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "GetAnnotatedDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotatedDataset", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ListAnnotatedDatasets_async", + "title": "datalabeling listAnnotatedDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists annotated datasets for a dataset. Pagination is supported.", + "canonical": true, + "file": "data_labeling_service.list_annotated_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAnnotatedDatasets", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotatedDatasets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ListAnnotatedDatasets", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotatedDatasets", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotatedDataset_async", + "title": "datalabeling deleteAnnotatedDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes an annotated dataset by resource name.", + "canonical": true, + "file": "data_labeling_service.delete_annotated_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAnnotatedDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotatedDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "DeleteAnnotatedDataset", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotatedDataset", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_LabelImage_async", + "title": "datalabeling labelImage Sample", + "origin": "API_DEFINITION", + "description": " Starts a labeling task for image. The type of image labeling task is configured by feature in the request.", + "canonical": true, + "file": "data_labeling_service.label_image.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LabelImage", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.LabelImage", + "async": true, + "parameters": [ + { + "name": "image_classification_config", + "type": ".google.cloud.datalabeling.v1beta1.ImageClassificationConfig" + }, + { + "name": "bounding_poly_config", + "type": ".google.cloud.datalabeling.v1beta1.BoundingPolyConfig" + }, + { + "name": "polyline_config", + "type": ".google.cloud.datalabeling.v1beta1.PolylineConfig" + }, + { + "name": "segmentation_config", + "type": ".google.cloud.datalabeling.v1beta1.SegmentationConfig" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "basic_config", + "type": ".google.cloud.datalabeling.v1beta1.HumanAnnotationConfig" + }, + { + "name": "feature", + "type": ".google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "LabelImage", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.LabelImage", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_LabelVideo_async", + "title": "datalabeling labelVideo Sample", + "origin": "API_DEFINITION", + "description": " Starts a labeling task for video. The type of video labeling task is configured by feature in the request.", + "canonical": true, + "file": "data_labeling_service.label_video.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LabelVideo", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.LabelVideo", + "async": true, + "parameters": [ + { + "name": "video_classification_config", + "type": ".google.cloud.datalabeling.v1beta1.VideoClassificationConfig" + }, + { + "name": "object_detection_config", + "type": ".google.cloud.datalabeling.v1beta1.ObjectDetectionConfig" + }, + { + "name": "object_tracking_config", + "type": ".google.cloud.datalabeling.v1beta1.ObjectTrackingConfig" + }, + { + "name": "event_config", + "type": ".google.cloud.datalabeling.v1beta1.EventConfig" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "basic_config", + "type": ".google.cloud.datalabeling.v1beta1.HumanAnnotationConfig" + }, + { + "name": "feature", + "type": ".google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "LabelVideo", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.LabelVideo", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_LabelText_async", + "title": "datalabeling labelText Sample", + "origin": "API_DEFINITION", + "description": " Starts a labeling task for text. The type of text labeling task is configured by feature in the request.", + "canonical": true, + "file": "data_labeling_service.label_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LabelText", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.LabelText", + "async": true, + "parameters": [ + { + "name": "text_classification_config", + "type": ".google.cloud.datalabeling.v1beta1.TextClassificationConfig" + }, + { + "name": "text_entity_extraction_config", + "type": ".google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "basic_config", + "type": ".google.cloud.datalabeling.v1beta1.HumanAnnotationConfig" + }, + { + "name": "feature", + "type": ".google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "LabelText", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.LabelText", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_GetExample_async", + "title": "datalabeling getExample Sample", + "origin": "API_DEFINITION", + "description": " Gets an example by resource name, including both data and annotation.", + "canonical": true, + "file": "data_labeling_service.get_example.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetExample", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetExample", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.Example", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "GetExample", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetExample", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ListExamples_async", + "title": "datalabeling listExamples Sample", + "origin": "API_DEFINITION", + "description": " Lists examples in an annotated dataset. Pagination is supported.", + "canonical": true, + "file": "data_labeling_service.list_examples.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListExamples", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListExamples", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.ListExamplesResponse", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ListExamples", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListExamples", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_CreateAnnotationSpecSet_async", + "title": "datalabeling createAnnotationSpecSet Sample", + "origin": "API_DEFINITION", + "description": " Creates an annotation spec set by providing a set of labels.", + "canonical": true, + "file": "data_labeling_service.create_annotation_spec_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAnnotationSpecSet", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.CreateAnnotationSpecSet", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "annotation_spec_set", + "type": ".google.cloud.datalabeling.v1beta1.AnnotationSpecSet" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.AnnotationSpecSet", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "CreateAnnotationSpecSet", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.CreateAnnotationSpecSet", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_GetAnnotationSpecSet_async", + "title": "datalabeling getAnnotationSpecSet Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotation spec set by resource name.", + "canonical": true, + "file": "data_labeling_service.get_annotation_spec_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotationSpecSet", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotationSpecSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.AnnotationSpecSet", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "GetAnnotationSpecSet", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotationSpecSet", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ListAnnotationSpecSets_async", + "title": "datalabeling listAnnotationSpecSets Sample", + "origin": "API_DEFINITION", + "description": " Lists annotation spec sets for a project. Pagination is supported.", + "canonical": true, + "file": "data_labeling_service.list_annotation_spec_sets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAnnotationSpecSets", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotationSpecSets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ListAnnotationSpecSets", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotationSpecSets", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotationSpecSet_async", + "title": "datalabeling deleteAnnotationSpecSet Sample", + "origin": "API_DEFINITION", + "description": " Deletes an annotation spec set by resource name.", + "canonical": true, + "file": "data_labeling_service.delete_annotation_spec_set.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAnnotationSpecSet", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotationSpecSet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "DeleteAnnotationSpecSet", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotationSpecSet", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_CreateInstruction_async", + "title": "datalabeling createInstruction Sample", + "origin": "API_DEFINITION", + "description": " Creates an instruction for how data should be labeled.", + "canonical": true, + "file": "data_labeling_service.create_instruction.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstruction", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.CreateInstruction", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instruction", + "type": ".google.cloud.datalabeling.v1beta1.Instruction" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "CreateInstruction", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.CreateInstruction", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_GetInstruction_async", + "title": "datalabeling getInstruction Sample", + "origin": "API_DEFINITION", + "description": " Gets an instruction by resource name.", + "canonical": true, + "file": "data_labeling_service.get_instruction.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstruction", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetInstruction", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.Instruction", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "GetInstruction", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetInstruction", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ListInstructions_async", + "title": "datalabeling listInstructions Sample", + "origin": "API_DEFINITION", + "description": " Lists instructions for a project. Pagination is supported.", + "canonical": true, + "file": "data_labeling_service.list_instructions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstructions", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListInstructions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.ListInstructionsResponse", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ListInstructions", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListInstructions", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_DeleteInstruction_async", + "title": "datalabeling deleteInstruction Sample", + "origin": "API_DEFINITION", + "description": " Deletes an instruction object by resource name.", + "canonical": true, + "file": "data_labeling_service.delete_instruction.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstruction", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteInstruction", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "DeleteInstruction", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteInstruction", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_GetEvaluation_async", + "title": "datalabeling getEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets an evaluation by resource name (to search, use [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]).", + "canonical": true, + "file": "data_labeling_service.get_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvaluation", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.Evaluation", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "GetEvaluation", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluation", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_SearchEvaluations_async", + "title": "datalabeling searchEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.", + "canonical": true, + "file": "data_labeling_service.search_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 101, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchEvaluations", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "SearchEvaluations", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_SearchExampleComparisons_async", + "title": "datalabeling searchExampleComparisons Sample", + "origin": "API_DEFINITION", + "description": " Searches example comparisons from an evaluation. The return format is a list of example comparisons that show ground truth and prediction(s) for a single input. Search by providing an evaluation ID.", + "canonical": true, + "file": "data_labeling_service.search_example_comparisons.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchExampleComparisons", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.SearchExampleComparisons", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "SearchExampleComparisons", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.SearchExampleComparisons", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_CreateEvaluationJob_async", + "title": "datalabeling createEvaluationJob Sample", + "origin": "API_DEFINITION", + "description": " Creates an evaluation job.", + "canonical": true, + "file": "data_labeling_service.create_evaluation_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.CreateEvaluationJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.datalabeling.v1beta1.EvaluationJob" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.EvaluationJob", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "CreateEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.CreateEvaluationJob", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_UpdateEvaluationJob_async", + "title": "datalabeling updateEvaluationJob Sample", + "origin": "API_DEFINITION", + "description": " Updates an evaluation job. You can only update certain fields of the job's [EvaluationJobConfig][google.cloud.datalabeling.v1beta1.EvaluationJobConfig]: `humanAnnotationConfig.instruction`, `exampleCount`, and `exampleSamplePercentage`. If you want to change any other aspect of the evaluation job, you must delete the job and create a new one.", + "canonical": true, + "file": "data_labeling_service.update_evaluation_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.UpdateEvaluationJob", + "async": true, + "parameters": [ + { + "name": "evaluation_job", + "type": ".google.cloud.datalabeling.v1beta1.EvaluationJob" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.EvaluationJob", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "UpdateEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.UpdateEvaluationJob", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_GetEvaluationJob_async", + "title": "datalabeling getEvaluationJob Sample", + "origin": "API_DEFINITION", + "description": " Gets an evaluation job by resource name.", + "canonical": true, + "file": "data_labeling_service.get_evaluation_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.EvaluationJob", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "GetEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluationJob", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_PauseEvaluationJob_async", + "title": "datalabeling pauseEvaluationJob Sample", + "origin": "API_DEFINITION", + "description": " Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a no-op.", + "canonical": true, + "file": "data_labeling_service.pause_evaluation_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PauseEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.PauseEvaluationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "PauseEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.PauseEvaluationJob", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ResumeEvaluationJob_async", + "title": "datalabeling resumeEvaluationJob Sample", + "origin": "API_DEFINITION", + "description": " Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running or scheduled evaluation job is a no-op.", + "canonical": true, + "file": "data_labeling_service.resume_evaluation_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResumeEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ResumeEvaluationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ResumeEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ResumeEvaluationJob", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_DeleteEvaluationJob_async", + "title": "datalabeling deleteEvaluationJob Sample", + "origin": "API_DEFINITION", + "description": " Stops and deletes an evaluation job.", + "canonical": true, + "file": "data_labeling_service.delete_evaluation_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteEvaluationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "DeleteEvaluationJob", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteEvaluationJob", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + }, + { + "regionTag": "datalabeling_v1beta1_generated_DataLabelingService_ListEvaluationJobs_async", + "title": "datalabeling listEvaluationJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists all evaluation jobs within a project with possible filters. Pagination is supported.", + "canonical": true, + "file": "data_labeling_service.list_evaluation_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvaluationJobs", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListEvaluationJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse", + "client": { + "shortName": "DataLabelingServiceClient", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingServiceClient" + }, + "method": { + "shortName": "ListEvaluationJobs", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService.ListEvaluationJobs", + "service": { + "shortName": "DataLabelingService", + "fullName": "google.cloud.datalabeling.v1beta1.DataLabelingService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-datalabeling/samples/package.json b/packages/google-cloud-datalabeling/samples/package.json new file mode 100644 index 00000000000..71e77247395 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-datalabeling-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js", + "!test/" + ], + "scripts": { + "test": "mocha --timeout 600000" + }, + "dependencies": { + "@google-cloud/datalabeling": "^3.1.1" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-datalabeling/samples/quickstart.js b/packages/google-cloud-datalabeling/samples/quickstart.js new file mode 100644 index 00000000000..8f2a0825ef5 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/quickstart.js @@ -0,0 +1,36 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +// sample-metadata: +// title: Get Datasets +// description: Gets all available Datasets. +// usage: node quickstart.js + +function main(projectId) { + // [START datalabeling_quickstart] + const {DataLabelingServiceClient} = require('@google-cloud/datalabeling'); + const client = new DataLabelingServiceClient(); + + async function quickstart() { + const parent = client.projectPath(projectId); + const [result] = await client.listDatasets({parent}); + console.log('Datasets:'); + console.log(result); + } + quickstart(); + // [END datalabeling_quickstart] +} +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datalabeling/samples/test/quickstart.test.js b/packages/google-cloud-datalabeling/samples/test/quickstart.test.js new file mode 100644 index 00000000000..e98db8fac45 --- /dev/null +++ b/packages/google-cloud-datalabeling/samples/test/quickstart.test.js @@ -0,0 +1,36 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, before} = require('mocha'); +const {execSync} = require('child_process'); +const {DataLabelingServiceClient} = require('@google-cloud/datalabeling'); +const client = new DataLabelingServiceClient(); + +const exec = cmd => execSync(cmd, {encoding: 'utf8'}); + +describe('quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run the quickstart', () => { + const stdout = exec(`node quickstart.js ${projectId}`); + assert.include(stdout, 'Datasets:'); + }); +}); diff --git a/packages/google-cloud-datalabeling/src/index.ts b/packages/google-cloud-datalabeling/src/index.ts new file mode 100644 index 00000000000..3efd268fc2b --- /dev/null +++ b/packages/google-cloud-datalabeling/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; + +const DataLabelingServiceClient = v1beta1.DataLabelingServiceClient; +type DataLabelingServiceClient = v1beta1.DataLabelingServiceClient; + +export {v1beta1, DataLabelingServiceClient}; +export default {v1beta1, DataLabelingServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_client.ts b/packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_client.ts new file mode 100644 index 00000000000..dea6e1562aa --- /dev/null +++ b/packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_client.ts @@ -0,0 +1,5826 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/data_labeling_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_labeling_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for the AI Platform Data Labeling API. + * @class + * @memberof v1beta1 + */ +export class DataLabelingServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + dataLabelingServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataLabelingServiceClient. + * + * @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 DataLabelingServiceClient({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 DataLabelingServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotatedDatasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}' + ), + annotationSpecSetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/annotationSpecSets/{annotation_spec_set}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}/dataItems/{data_item}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}' + ), + evaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}/evaluations/{evaluation}' + ), + evaluationJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/evaluationJobs/{evaluation_job}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}' + ), + instructionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/instructions/{instruction}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listDatasets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'datasets' + ), + listDataItems: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataItems' + ), + listAnnotatedDatasets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'annotatedDatasets' + ), + listExamples: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'examples' + ), + listAnnotationSpecSets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'annotationSpecSets' + ), + listInstructions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instructions' + ), + searchEvaluations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'evaluations' + ), + searchExampleComparisons: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'exampleComparisons' + ), + listEvaluationJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'evaluationJobs' + ), + }; + + 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', + get: '/v1beta1/{name=projects/*/operations/*}:cancel', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=projects/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=projects/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=projects/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const importDataResponse = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse' + ) as gax.protobuf.Type; + const importDataMetadata = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata' + ) as gax.protobuf.Type; + const exportDataResponse = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse' + ) as gax.protobuf.Type; + const exportDataMetadata = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata' + ) as gax.protobuf.Type; + const labelImageResponse = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.AnnotatedDataset' + ) as gax.protobuf.Type; + const labelImageMetadata = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.LabelOperationMetadata' + ) as gax.protobuf.Type; + const labelVideoResponse = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.AnnotatedDataset' + ) as gax.protobuf.Type; + const labelVideoMetadata = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.LabelOperationMetadata' + ) as gax.protobuf.Type; + const labelTextResponse = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.AnnotatedDataset' + ) as gax.protobuf.Type; + const labelTextMetadata = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.LabelOperationMetadata' + ) as gax.protobuf.Type; + const createInstructionResponse = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.Instruction' + ) as gax.protobuf.Type; + const createInstructionMetadata = protoFilesRoot.lookup( + '.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + importData: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importDataResponse.decode.bind(importDataResponse), + importDataMetadata.decode.bind(importDataMetadata) + ), + exportData: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportDataResponse.decode.bind(exportDataResponse), + exportDataMetadata.decode.bind(exportDataMetadata) + ), + labelImage: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + labelImageResponse.decode.bind(labelImageResponse), + labelImageMetadata.decode.bind(labelImageMetadata) + ), + labelVideo: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + labelVideoResponse.decode.bind(labelVideoResponse), + labelVideoMetadata.decode.bind(labelVideoMetadata) + ), + labelText: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + labelTextResponse.decode.bind(labelTextResponse), + labelTextMetadata.decode.bind(labelTextMetadata) + ), + createInstruction: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstructionResponse.decode.bind(createInstructionResponse), + createInstructionMetadata.decode.bind(createInstructionMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.datalabeling.v1beta1.DataLabelingService', + 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.dataLabelingServiceStub) { + return this.dataLabelingServiceStub; + } + + // Put together the "service stub" for + // google.cloud.datalabeling.v1beta1.DataLabelingService. + this.dataLabelingServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.datalabeling.v1beta1.DataLabelingService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.datalabeling.v1beta1 + .DataLabelingService, + 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 dataLabelingServiceStubMethods = [ + 'createDataset', + 'getDataset', + 'listDatasets', + 'deleteDataset', + 'importData', + 'exportData', + 'getDataItem', + 'listDataItems', + 'getAnnotatedDataset', + 'listAnnotatedDatasets', + 'deleteAnnotatedDataset', + 'labelImage', + 'labelVideo', + 'labelText', + 'getExample', + 'listExamples', + 'createAnnotationSpecSet', + 'getAnnotationSpecSet', + 'listAnnotationSpecSets', + 'deleteAnnotationSpecSet', + 'createInstruction', + 'getInstruction', + 'listInstructions', + 'deleteInstruction', + 'getEvaluation', + 'searchEvaluations', + 'searchExampleComparisons', + 'createEvaluationJob', + 'updateEvaluationJob', + 'getEvaluationJob', + 'pauseEvaluationJob', + 'resumeEvaluationJob', + 'deleteEvaluationJob', + 'listEvaluationJobs', + ]; + for (const methodName of dataLabelingServiceStubMethods) { + const callPromise = this.dataLabelingServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.dataLabelingServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'datalabeling.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 'datalabeling.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates dataset. If success return a Dataset resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Dataset resource parent, format: + * projects/{project_id} + * @param {google.cloud.datalabeling.v1beta1.Dataset} request.dataset + * Required. The dataset to be created. + * @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 [Dataset]{@link google.cloud.datalabeling.v1beta1.Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.create_dataset.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_CreateDataset_async + */ + createDataset( + request?: protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataset, + ( + | protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest + | undefined + ), + {} | undefined + ] + >; + createDataset( + request: protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IDataset, + | protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataset( + request: protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IDataset, + | protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataset( + request?: protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IDataset, + | protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IDataset, + | protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataset, + ( + | protos.google.cloud.datalabeling.v1beta1.ICreateDatasetRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createDataset(request, options, callback); + } + /** + * Gets dataset by resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset resource name, format: + * projects/{project_id}/datasets/{dataset_id} + * @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 [Dataset]{@link google.cloud.datalabeling.v1beta1.Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.get_dataset.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_GetDataset_async + */ + getDataset( + request?: protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataset, + protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest | undefined, + {} | undefined + ] + >; + getDataset( + request: protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IDataset, + | protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataset( + request: protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IDataset, + | protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataset( + request?: protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IDataset, + | protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IDataset, + | protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataset, + protos.google.cloud.datalabeling.v1beta1.IGetDatasetRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getDataset(request, options, callback); + } + /** + * Deletes a dataset by resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset resource name, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.delete_dataset.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_DeleteDataset_async + */ + deleteDataset( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest + | undefined + ), + {} | undefined + ] + >; + deleteDataset( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteDatasetRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteDataset(request, options, callback); + } + /** + * Gets a data item in a dataset by resource name. This API can be + * called after data are imported into dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the data item to get, format: + * projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + * @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 [DataItem]{@link google.cloud.datalabeling.v1beta1.DataItem}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.get_data_item.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_GetDataItem_async + */ + getDataItem( + request?: protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataItem, + protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest | undefined, + {} | undefined + ] + >; + getDataItem( + request: protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IDataItem, + | protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataItem( + request: protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IDataItem, + | protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataItem( + request?: protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IDataItem, + | protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IDataItem, + | protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataItem, + protos.google.cloud.datalabeling.v1beta1.IGetDataItemRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getDataItem(request, options, callback); + } + /** + * Gets an annotated dataset by resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the annotated dataset to get, format: + * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + * {annotated_dataset_id} + * @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 [AnnotatedDataset]{@link google.cloud.datalabeling.v1beta1.AnnotatedDataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.get_annotated_dataset.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_GetAnnotatedDataset_async + */ + getAnnotatedDataset( + request?: protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest + | undefined + ), + {} | undefined + ] + >; + getAnnotatedDataset( + request: protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotatedDataset( + request: protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotatedDataset( + request?: protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotatedDatasetRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getAnnotatedDataset(request, options, callback); + } + /** + * Deletes an annotated dataset by resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the annotated dataset to delete, format: + * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + * {annotated_dataset_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.delete_annotated_dataset.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotatedDataset_async + */ + deleteAnnotatedDataset( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest + | undefined + ), + {} | undefined + ] + >; + deleteAnnotatedDataset( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAnnotatedDataset( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAnnotatedDataset( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotatedDatasetRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteAnnotatedDataset( + request, + options, + callback + ); + } + /** + * Gets an example by resource name, including both data and annotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of example, format: + * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + * {annotated_dataset_id}/examples/{example_id} + * @param {string} [request.filter] + * Optional. An expression for filtering Examples. Filter by + * annotation_spec.display_name is supported. Format + * "annotation_spec.display_name = {display_name}" + * @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 [Example]{@link google.cloud.datalabeling.v1beta1.Example}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.get_example.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_GetExample_async + */ + getExample( + request?: protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IExample, + protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest | undefined, + {} | undefined + ] + >; + getExample( + request: protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IExample, + | protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getExample( + request: protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IExample, + | protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getExample( + request?: protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IExample, + | protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IExample, + | protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IExample, + protos.google.cloud.datalabeling.v1beta1.IGetExampleRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getExample(request, options, callback); + } + /** + * Creates an annotation spec set by providing a set of labels. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. AnnotationSpecSet resource parent, format: + * projects/{project_id} + * @param {google.cloud.datalabeling.v1beta1.AnnotationSpecSet} request.annotationSpecSet + * Required. Annotation spec set to create. Annotation specs must be included. + * Only one annotation spec will be accepted for annotation specs with same + * display_name. + * @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 [AnnotationSpecSet]{@link google.cloud.datalabeling.v1beta1.AnnotationSpecSet}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.create_annotation_spec_set.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_CreateAnnotationSpecSet_async + */ + createAnnotationSpecSet( + request?: protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + ( + | protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest + | undefined + ), + {} | undefined + ] + >; + createAnnotationSpecSet( + request: protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + | protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAnnotationSpecSet( + request: protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + | protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAnnotationSpecSet( + request?: protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + | protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + | protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + ( + | protos.google.cloud.datalabeling.v1beta1.ICreateAnnotationSpecSetRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createAnnotationSpecSet( + request, + options, + callback + ); + } + /** + * Gets an annotation spec set by resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. AnnotationSpecSet resource name, format: + * projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + * @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 [AnnotationSpecSet]{@link google.cloud.datalabeling.v1beta1.AnnotationSpecSet}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.get_annotation_spec_set.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_GetAnnotationSpecSet_async + */ + getAnnotationSpecSet( + request?: protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest + | undefined + ), + {} | undefined + ] + >; + getAnnotationSpecSet( + request: protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpecSet( + request: protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpecSet( + request?: protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetAnnotationSpecSetRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getAnnotationSpecSet(request, options, callback); + } + /** + * Deletes an annotation spec set by resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. AnnotationSpec resource name, format: + * `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.delete_annotation_spec_set.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotationSpecSet_async + */ + deleteAnnotationSpecSet( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest + | undefined + ), + {} | undefined + ] + >; + deleteAnnotationSpecSet( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAnnotationSpecSet( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAnnotationSpecSet( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteAnnotationSpecSetRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteAnnotationSpecSet( + request, + options, + callback + ); + } + /** + * Gets an instruction by resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Instruction resource name, format: + * projects/{project_id}/instructions/{instruction_id} + * @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 [Instruction]{@link google.cloud.datalabeling.v1beta1.Instruction}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.get_instruction.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_GetInstruction_async + */ + getInstruction( + request?: protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IInstruction, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest + | undefined + ), + {} | undefined + ] + >; + getInstruction( + request: protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + | protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstruction( + request: protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + | protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstruction( + request?: protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + | protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + | protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IInstruction, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetInstructionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getInstruction(request, options, callback); + } + /** + * Deletes an instruction object by resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Instruction resource name, format: + * projects/{project_id}/instructions/{instruction_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.delete_instruction.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_DeleteInstruction_async + */ + deleteInstruction( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest + | undefined + ), + {} | undefined + ] + >; + deleteInstruction( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteInstruction( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteInstruction( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteInstructionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteInstruction(request, options, callback); + } + /** + * Gets an evaluation by resource name (to search, use + * {@link google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations|projects.evaluations.search}). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the evaluation. Format: + * + * "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}' + * @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 [Evaluation]{@link google.cloud.datalabeling.v1beta1.Evaluation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.get_evaluation.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_GetEvaluation_async + */ + getEvaluation( + request?: protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluation, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest + | undefined + ), + {} | undefined + ] + >; + getEvaluation( + request: protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluation, + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEvaluation( + request: protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluation, + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEvaluation( + request?: protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluation, + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluation, + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluation, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getEvaluation(request, options, callback); + } + /** + * Creates an evaluation job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Evaluation job resource parent. Format: + * "projects/{project_id}" + * @param {google.cloud.datalabeling.v1beta1.EvaluationJob} request.job + * Required. The evaluation job to create. + * @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 [EvaluationJob]{@link google.cloud.datalabeling.v1beta1.EvaluationJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.create_evaluation_job.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_CreateEvaluationJob_async + */ + createEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + ( + | protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest + | undefined + ), + {} | undefined + ] + >; + createEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + ( + | protos.google.cloud.datalabeling.v1beta1.ICreateEvaluationJobRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createEvaluationJob(request, options, callback); + } + /** + * Updates an evaluation job. You can only update certain fields of the job's + * {@link google.cloud.datalabeling.v1beta1.EvaluationJobConfig|EvaluationJobConfig}: `humanAnnotationConfig.instruction`, + * `exampleCount`, and `exampleSamplePercentage`. + * + * If you want to change any other aspect of the evaluation job, you must + * delete the job and create a new one. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datalabeling.v1beta1.EvaluationJob} request.evaluationJob + * Required. Evaluation job that is going to be updated. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Mask for which fields to update. You can only provide the + * following fields: + * + * * `evaluationJobConfig.humanAnnotationConfig.instruction` + * * `evaluationJobConfig.exampleCount` + * * `evaluationJobConfig.exampleSamplePercentage` + * + * You can provide more than one of these fields by separating them with + * commas. + * @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 [EvaluationJob]{@link google.cloud.datalabeling.v1beta1.EvaluationJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.update_evaluation_job.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_UpdateEvaluationJob_async + */ + updateEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + ( + | protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest + | undefined + ), + {} | undefined + ] + >; + updateEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + ( + | protos.google.cloud.datalabeling.v1beta1.IUpdateEvaluationJobRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'evaluation_job.name': request.evaluationJob!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEvaluationJob(request, options, callback); + } + /** + * Gets an evaluation job by resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the evaluation job. Format: + * + * "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + * @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 [EvaluationJob]{@link google.cloud.datalabeling.v1beta1.EvaluationJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.get_evaluation_job.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_GetEvaluationJob_async + */ + getEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest + | undefined + ), + {} | undefined + ] + >; + getEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest, + callback: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob, + ( + | protos.google.cloud.datalabeling.v1beta1.IGetEvaluationJobRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getEvaluationJob(request, options, callback); + } + /** + * Pauses an evaluation job. Pausing an evaluation job that is already in a + * `PAUSED` state is a no-op. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the evaluation job that is going to be paused. Format: + * + * "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.pause_evaluation_job.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_PauseEvaluationJob_async + */ + pauseEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest + | undefined + ), + {} | undefined + ] + >; + pauseEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pauseEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pauseEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IPauseEvaluationJobRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.pauseEvaluationJob(request, options, callback); + } + /** + * Resumes a paused evaluation job. A deleted evaluation job can't be resumed. + * Resuming a running or scheduled evaluation job is a no-op. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the evaluation job that is going to be resumed. Format: + * + * "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.resume_evaluation_job.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ResumeEvaluationJob_async + */ + resumeEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest + | undefined + ), + {} | undefined + ] + >; + resumeEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resumeEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resumeEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IResumeEvaluationJobRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.resumeEvaluationJob(request, options, callback); + } + /** + * Stops and deletes an evaluation job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the evaluation job that is going to be deleted. Format: + * + * "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.delete_evaluation_job.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_DeleteEvaluationJob_async + */ + deleteEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest + | undefined + ), + {} | undefined + ] + >; + deleteEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteEvaluationJob( + request: protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteEvaluationJob( + request?: protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.datalabeling.v1beta1.IDeleteEvaluationJobRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteEvaluationJob(request, options, callback); + } + + /** + * Imports data into dataset based on source locations defined in request. + * It can be called multiple times for the same dataset. Each dataset can + * only have one long running operation running on it. For example, no + * labeling task (also long running operation) can be started while + * importing is still ongoing. Vice versa. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset resource name, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {google.cloud.datalabeling.v1beta1.InputConfig} request.inputConfig + * Required. Specify the input source of the data. + * @param {string} request.userEmailAddress + * Email of the user who started the import task and should be notified by + * email. If empty no notification will be sent. + * @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/v1beta1/data_labeling_service.import_data.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ImportData_async + */ + importData( + request?: protos.google.cloud.datalabeling.v1beta1.IImportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + importData( + request: protos.google.cloud.datalabeling.v1beta1.IImportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request: protos.google.cloud.datalabeling.v1beta1.IImportDataRequest, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request?: protos.google.cloud.datalabeling.v1beta1.IImportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.importData(request, options, callback); + } + /** + * Check the status of the long running operation returned by `importData()`. + * @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/v1beta1/data_labeling_service.import_data.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ImportData_async + */ + async checkImportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + > + > { + 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.importData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata + >; + } + /** + * Exports data and annotations from dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset resource name, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {string} request.annotatedDataset + * Required. Annotated dataset resource name. DataItem in + * Dataset and their annotations in specified annotated dataset will be + * exported. It's in format of + * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + * {annotated_dataset_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {google.cloud.datalabeling.v1beta1.OutputConfig} request.outputConfig + * Required. Specify the output destination. + * @param {string} request.userEmailAddress + * Email of the user who started the export task and should be notified by + * email. If empty no notification will be sent. + * @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/v1beta1/data_labeling_service.export_data.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ExportData_async + */ + exportData( + request?: protos.google.cloud.datalabeling.v1beta1.IExportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + exportData( + request: protos.google.cloud.datalabeling.v1beta1.IExportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request: protos.google.cloud.datalabeling.v1beta1.IExportDataRequest, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request?: protos.google.cloud.datalabeling.v1beta1.IExportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.exportData(request, options, callback); + } + /** + * Check the status of the long running operation returned by `exportData()`. + * @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/v1beta1/data_labeling_service.export_data.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ExportData_async + */ + async checkExportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + > + > { + 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.exportData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata + >; + } + /** + * Starts a labeling task for image. The type of image labeling task is + * configured by feature in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datalabeling.v1beta1.ImageClassificationConfig} request.imageClassificationConfig + * Configuration for image classification task. + * One of image_classification_config, bounding_poly_config, + * polyline_config and segmentation_config are required. + * @param {google.cloud.datalabeling.v1beta1.BoundingPolyConfig} request.boundingPolyConfig + * Configuration for bounding box and bounding poly task. + * One of image_classification_config, bounding_poly_config, + * polyline_config and segmentation_config are required. + * @param {google.cloud.datalabeling.v1beta1.PolylineConfig} request.polylineConfig + * Configuration for polyline task. + * One of image_classification_config, bounding_poly_config, + * polyline_config and segmentation_config are required. + * @param {google.cloud.datalabeling.v1beta1.SegmentationConfig} request.segmentationConfig + * Configuration for segmentation task. + * One of image_classification_config, bounding_poly_config, + * polyline_config and segmentation_config are required. + * @param {string} request.parent + * Required. Name of the dataset to request labeling task, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {google.cloud.datalabeling.v1beta1.HumanAnnotationConfig} request.basicConfig + * Required. Basic human annotation config. + * @param {google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature} request.feature + * Required. The type of image labeling task. + * @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/v1beta1/data_labeling_service.label_image.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_LabelImage_async + */ + labelImage( + request?: protos.google.cloud.datalabeling.v1beta1.ILabelImageRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + labelImage( + request: protos.google.cloud.datalabeling.v1beta1.ILabelImageRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + labelImage( + request: protos.google.cloud.datalabeling.v1beta1.ILabelImageRequest, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + labelImage( + request?: protos.google.cloud.datalabeling.v1beta1.ILabelImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.labelImage(request, options, callback); + } + /** + * Check the status of the long running operation returned by `labelImage()`. + * @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/v1beta1/data_labeling_service.label_image.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_LabelImage_async + */ + async checkLabelImageProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.LabelOperationMetadata + > + > { + 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.labelImage, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.LabelOperationMetadata + >; + } + /** + * Starts a labeling task for video. The type of video labeling task is + * configured by feature in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datalabeling.v1beta1.VideoClassificationConfig} request.videoClassificationConfig + * Configuration for video classification task. + * One of video_classification_config, object_detection_config, + * object_tracking_config and event_config is required. + * @param {google.cloud.datalabeling.v1beta1.ObjectDetectionConfig} request.objectDetectionConfig + * Configuration for video object detection task. + * One of video_classification_config, object_detection_config, + * object_tracking_config and event_config is required. + * @param {google.cloud.datalabeling.v1beta1.ObjectTrackingConfig} request.objectTrackingConfig + * Configuration for video object tracking task. + * One of video_classification_config, object_detection_config, + * object_tracking_config and event_config is required. + * @param {google.cloud.datalabeling.v1beta1.EventConfig} request.eventConfig + * Configuration for video event task. + * One of video_classification_config, object_detection_config, + * object_tracking_config and event_config is required. + * @param {string} request.parent + * Required. Name of the dataset to request labeling task, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {google.cloud.datalabeling.v1beta1.HumanAnnotationConfig} request.basicConfig + * Required. Basic human annotation config. + * @param {google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature} request.feature + * Required. The type of video labeling task. + * @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/v1beta1/data_labeling_service.label_video.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_LabelVideo_async + */ + labelVideo( + request?: protos.google.cloud.datalabeling.v1beta1.ILabelVideoRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + labelVideo( + request: protos.google.cloud.datalabeling.v1beta1.ILabelVideoRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + labelVideo( + request: protos.google.cloud.datalabeling.v1beta1.ILabelVideoRequest, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + labelVideo( + request?: protos.google.cloud.datalabeling.v1beta1.ILabelVideoRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.labelVideo(request, options, callback); + } + /** + * Check the status of the long running operation returned by `labelVideo()`. + * @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/v1beta1/data_labeling_service.label_video.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_LabelVideo_async + */ + async checkLabelVideoProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.LabelOperationMetadata + > + > { + 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.labelVideo, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.LabelOperationMetadata + >; + } + /** + * Starts a labeling task for text. The type of text labeling task is + * configured by feature in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datalabeling.v1beta1.TextClassificationConfig} request.textClassificationConfig + * Configuration for text classification task. + * One of text_classification_config and text_entity_extraction_config + * is required. + * @param {google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig} request.textEntityExtractionConfig + * Configuration for entity extraction task. + * One of text_classification_config and text_entity_extraction_config + * is required. + * @param {string} request.parent + * Required. Name of the data set to request labeling task, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {google.cloud.datalabeling.v1beta1.HumanAnnotationConfig} request.basicConfig + * Required. Basic human annotation config. + * @param {google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature} request.feature + * Required. The type of text labeling task. + * @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/v1beta1/data_labeling_service.label_text.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_LabelText_async + */ + labelText( + request?: protos.google.cloud.datalabeling.v1beta1.ILabelTextRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + labelText( + request: protos.google.cloud.datalabeling.v1beta1.ILabelTextRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + labelText( + request: protos.google.cloud.datalabeling.v1beta1.ILabelTextRequest, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + labelText( + request?: protos.google.cloud.datalabeling.v1beta1.ILabelTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.labelText(request, options, callback); + } + /** + * Check the status of the long running operation returned by `labelText()`. + * @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/v1beta1/data_labeling_service.label_text.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_LabelText_async + */ + async checkLabelTextProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.LabelOperationMetadata + > + > { + 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.labelText, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.LabelOperationMetadata + >; + } + /** + * Creates an instruction for how data should be labeled. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Instruction resource parent, format: + * projects/{project_id} + * @param {google.cloud.datalabeling.v1beta1.Instruction} request.instruction + * Required. Instruction of how to perform the labeling task. + * @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/v1beta1/data_labeling_service.create_instruction.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_CreateInstruction_async + */ + createInstruction( + request?: protos.google.cloud.datalabeling.v1beta1.ICreateInstructionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + protos.google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createInstruction( + request: protos.google.cloud.datalabeling.v1beta1.ICreateInstructionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + protos.google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstruction( + request: protos.google.cloud.datalabeling.v1beta1.ICreateInstructionRequest, + callback: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + protos.google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstruction( + request?: protos.google.cloud.datalabeling.v1beta1.ICreateInstructionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + protos.google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + protos.google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + protos.google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createInstruction(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createInstruction()`. + * @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/v1beta1/data_labeling_service.create_instruction.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_CreateInstruction_async + */ + async checkCreateInstructionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datalabeling.v1beta1.Instruction, + protos.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + > + > { + 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.createInstruction, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datalabeling.v1beta1.Instruction, + protos.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata + >; + } + /** + * Lists datasets under a project. Pagination is supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Dataset resource parent, format: + * projects/{project_id} + * @param {string} [request.filter] + * Optional. Filter on dataset is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * [DataLabelingService.ListDatasets] call. + * Returns the first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Dataset]{@link google.cloud.datalabeling.v1beta1.Dataset}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDatasets( + request?: protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataset[], + protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListDatasetsResponse + ] + >; + listDatasets( + request: protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IDataset + > + ): void; + listDatasets( + request: protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IDataset + > + ): void; + listDatasets( + request?: protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IDataset + >, + callback?: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IDataset + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataset[], + protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListDatasetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listDatasets(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Dataset resource parent, format: + * projects/{project_id} + * @param {string} [request.filter] + * Optional. Filter on dataset is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * [DataLabelingService.ListDatasets] call. + * Returns the first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Dataset]{@link google.cloud.datalabeling.v1beta1.Dataset} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDatasetsStream( + request?: protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.createStream( + this.innerApiCalls.listDatasets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDatasets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Dataset resource parent, format: + * projects/{project_id} + * @param {string} [request.filter] + * Optional. Filter on dataset is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * [DataLabelingService.ListDatasets] call. + * Returns the first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Dataset]{@link google.cloud.datalabeling.v1beta1.Dataset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.list_datasets.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ListDatasets_async + */ + listDatasetsAsync( + request?: protos.google.cloud.datalabeling.v1beta1.IListDatasetsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.asyncIterate( + this.innerApiCalls['listDatasets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists data items in a dataset. This API can be called after data + * are imported into dataset. Pagination is supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the dataset to list data items, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token|ListDataItemsResponse.next_page_token} of the previous + * [DataLabelingService.ListDataItems] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DataItem]{@link google.cloud.datalabeling.v1beta1.DataItem}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataItems( + request?: protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataItem[], + protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListDataItemsResponse + ] + >; + listDataItems( + request: protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListDataItemsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IDataItem + > + ): void; + listDataItems( + request: protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListDataItemsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IDataItem + > + ): void; + listDataItems( + request?: protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListDataItemsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IDataItem + >, + callback?: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListDataItemsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IDataItem + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IDataItem[], + protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListDataItemsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listDataItems(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the dataset to list data items, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token|ListDataItemsResponse.next_page_token} of the previous + * [DataLabelingService.ListDataItems] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DataItem]{@link google.cloud.datalabeling.v1beta1.DataItem} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataItemsStream( + request?: protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataItems.createStream( + this.innerApiCalls.listDataItems as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDataItems`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the dataset to list data items, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token|ListDataItemsResponse.next_page_token} of the previous + * [DataLabelingService.ListDataItems] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataItem]{@link google.cloud.datalabeling.v1beta1.DataItem}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.list_data_items.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ListDataItems_async + */ + listDataItemsAsync( + request?: protos.google.cloud.datalabeling.v1beta1.IListDataItemsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataItems.asyncIterate( + this.innerApiCalls['listDataItems'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists annotated datasets for a dataset. Pagination is supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the dataset to list annotated datasets, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token|ListAnnotatedDatasetsResponse.next_page_token} of the previous + * [DataLabelingService.ListAnnotatedDatasets] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [AnnotatedDataset]{@link google.cloud.datalabeling.v1beta1.AnnotatedDataset}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAnnotatedDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnnotatedDatasets( + request?: protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset[], + protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse + ] + >; + listAnnotatedDatasets( + request: protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset + > + ): void; + listAnnotatedDatasets( + request: protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset + > + ): void; + listAnnotatedDatasets( + request?: protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset + >, + callback?: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset[], + protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAnnotatedDatasets(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the dataset to list annotated datasets, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token|ListAnnotatedDatasetsResponse.next_page_token} of the previous + * [DataLabelingService.ListAnnotatedDatasets] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [AnnotatedDataset]{@link google.cloud.datalabeling.v1beta1.AnnotatedDataset} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAnnotatedDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnnotatedDatasetsStream( + request?: protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnnotatedDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnnotatedDatasets.createStream( + this.innerApiCalls.listAnnotatedDatasets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAnnotatedDatasets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the dataset to list annotated datasets, format: + * projects/{project_id}/datasets/{dataset_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token|ListAnnotatedDatasetsResponse.next_page_token} of the previous + * [DataLabelingService.ListAnnotatedDatasets] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [AnnotatedDataset]{@link google.cloud.datalabeling.v1beta1.AnnotatedDataset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.list_annotated_datasets.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ListAnnotatedDatasets_async + */ + listAnnotatedDatasetsAsync( + request?: protos.google.cloud.datalabeling.v1beta1.IListAnnotatedDatasetsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnnotatedDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnnotatedDatasets.asyncIterate( + this.innerApiCalls['listAnnotatedDatasets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists examples in an annotated dataset. Pagination is supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example resource parent. + * @param {string} [request.filter] + * Optional. An expression for filtering Examples. For annotated datasets that + * have annotation spec set, filter by + * annotation_spec.display_name is supported. Format + * "annotation_spec.display_name = {display_name}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token|ListExamplesResponse.next_page_token} of the previous + * [DataLabelingService.ListExamples] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Example]{@link google.cloud.datalabeling.v1beta1.Example}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listExamplesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listExamples( + request?: protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IExample[], + protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListExamplesResponse + ] + >; + listExamples( + request: protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + | protos.google.cloud.datalabeling.v1beta1.IListExamplesResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IExample + > + ): void; + listExamples( + request: protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + | protos.google.cloud.datalabeling.v1beta1.IListExamplesResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IExample + > + ): void; + listExamples( + request?: protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + | protos.google.cloud.datalabeling.v1beta1.IListExamplesResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IExample + >, + callback?: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + | protos.google.cloud.datalabeling.v1beta1.IListExamplesResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IExample + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IExample[], + protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListExamplesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listExamples(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example resource parent. + * @param {string} [request.filter] + * Optional. An expression for filtering Examples. For annotated datasets that + * have annotation spec set, filter by + * annotation_spec.display_name is supported. Format + * "annotation_spec.display_name = {display_name}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token|ListExamplesResponse.next_page_token} of the previous + * [DataLabelingService.ListExamples] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Example]{@link google.cloud.datalabeling.v1beta1.Example} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listExamplesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listExamplesStream( + request?: protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExamples.createStream( + this.innerApiCalls.listExamples as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listExamples`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Example resource parent. + * @param {string} [request.filter] + * Optional. An expression for filtering Examples. For annotated datasets that + * have annotation spec set, filter by + * annotation_spec.display_name is supported. Format + * "annotation_spec.display_name = {display_name}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token|ListExamplesResponse.next_page_token} of the previous + * [DataLabelingService.ListExamples] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Example]{@link google.cloud.datalabeling.v1beta1.Example}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.list_examples.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ListExamples_async + */ + listExamplesAsync( + request?: protos.google.cloud.datalabeling.v1beta1.IListExamplesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExamples.asyncIterate( + this.innerApiCalls['listExamples'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists annotation spec sets for a project. Pagination is supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent of AnnotationSpecSet resource, format: + * projects/{project_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token|ListAnnotationSpecSetsResponse.next_page_token} of the previous + * [DataLabelingService.ListAnnotationSpecSets] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [AnnotationSpecSet]{@link google.cloud.datalabeling.v1beta1.AnnotationSpecSet}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAnnotationSpecSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnnotationSpecSets( + request?: protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet[], + protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse + ] + >; + listAnnotationSpecSets( + request: protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet + > + ): void; + listAnnotationSpecSets( + request: protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet + > + ): void; + listAnnotationSpecSets( + request?: protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet + >, + callback?: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet[], + protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAnnotationSpecSets( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent of AnnotationSpecSet resource, format: + * projects/{project_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token|ListAnnotationSpecSetsResponse.next_page_token} of the previous + * [DataLabelingService.ListAnnotationSpecSets] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [AnnotationSpecSet]{@link google.cloud.datalabeling.v1beta1.AnnotationSpecSet} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAnnotationSpecSetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnnotationSpecSetsStream( + request?: protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnnotationSpecSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnnotationSpecSets.createStream( + this.innerApiCalls.listAnnotationSpecSets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAnnotationSpecSets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent of AnnotationSpecSet resource, format: + * projects/{project_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token|ListAnnotationSpecSetsResponse.next_page_token} of the previous + * [DataLabelingService.ListAnnotationSpecSets] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [AnnotationSpecSet]{@link google.cloud.datalabeling.v1beta1.AnnotationSpecSet}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.list_annotation_spec_sets.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ListAnnotationSpecSets_async + */ + listAnnotationSpecSetsAsync( + request?: protos.google.cloud.datalabeling.v1beta1.IListAnnotationSpecSetsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnnotationSpecSets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnnotationSpecSets.asyncIterate( + this.innerApiCalls['listAnnotationSpecSets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists instructions for a project. Pagination is supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Instruction resource parent, format: + * projects/{project_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token|ListInstructionsResponse.next_page_token} of the previous + * [DataLabelingService.ListInstructions] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Instruction]{@link google.cloud.datalabeling.v1beta1.Instruction}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstructionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInstructions( + request?: protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IInstruction[], + protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListInstructionsResponse + ] + >; + listInstructions( + request: protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListInstructionsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IInstruction + > + ): void; + listInstructions( + request: protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListInstructionsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IInstruction + > + ): void; + listInstructions( + request?: protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListInstructionsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IInstruction + >, + callback?: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListInstructionsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IInstruction + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IInstruction[], + protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListInstructionsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listInstructions(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Instruction resource parent, format: + * projects/{project_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token|ListInstructionsResponse.next_page_token} of the previous + * [DataLabelingService.ListInstructions] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Instruction]{@link google.cloud.datalabeling.v1beta1.Instruction} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstructionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInstructionsStream( + request?: protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstructions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstructions.createStream( + this.innerApiCalls.listInstructions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInstructions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Instruction resource parent, format: + * projects/{project_id} + * @param {string} [request.filter] + * Optional. Filter is not supported at this moment. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by + * {@link google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token|ListInstructionsResponse.next_page_token} of the previous + * [DataLabelingService.ListInstructions] call. + * Return first page if empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Instruction]{@link google.cloud.datalabeling.v1beta1.Instruction}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.list_instructions.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ListInstructions_async + */ + listInstructionsAsync( + request?: protos.google.cloud.datalabeling.v1beta1.IListInstructionsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstructions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstructions.asyncIterate( + this.innerApiCalls['listInstructions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Searches {@link google.cloud.datalabeling.v1beta1.Evaluation|evaluations} within a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Evaluation search parent (project ID). Format: + * "projects/{project_id}" + * @param {string} [request.filter] + * Optional. To search evaluations, you can filter by the following: + * + * * evaluation_job.evaluation_job_id (the last part of + * {@link google.cloud.datalabeling.v1beta1.EvaluationJob.name|EvaluationJob.name}) + * * evaluation_job.model_id (the {model_name} portion + * of {@link google.cloud.datalabeling.v1beta1.EvaluationJob.model_version|EvaluationJob.modelVersion}) + * * evaluation_job.evaluation_job_run_time_start (Minimum + * threshold for the + * {@link google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time|evaluationJobRunTime} that created + * the evaluation) + * * evaluation_job.evaluation_job_run_time_end (Maximum + * threshold for the + * {@link google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time|evaluationJobRunTime} that created + * the evaluation) + * * evaluation_job.job_state ({@link google.cloud.datalabeling.v1beta1.EvaluationJob.state|EvaluationJob.state}) + * * annotation_spec.display_name (the Evaluation contains a + * metric for the annotation spec with this + * {@link google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name|displayName}) + * + * To filter by multiple critiera, use the `AND` operator or the `OR` + * operator. The following examples shows a string that filters by several + * critiera: + * + * "evaluation_job.evaluation_job_id = + * {evaluation_job_id} AND evaluation_job.model_id = + * {model_name} AND + * evaluation_job.evaluation_job_run_time_start = + * {timestamp_1} AND + * evaluation_job.evaluation_job_run_time_end = + * {timestamp_2} AND annotation_spec.display_name = + * {display_name}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.next_page_token|nextPageToken} of the response + * to a previous search request. + * + * If you don't specify this field, the API call requests the first page of + * the search. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Evaluation]{@link google.cloud.datalabeling.v1beta1.Evaluation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchEvaluations( + request?: protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluation[], + protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest | null, + protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse + ] + >; + searchEvaluations( + request: protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + | protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IEvaluation + > + ): void; + searchEvaluations( + request: protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + | protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IEvaluation + > + ): void; + searchEvaluations( + request?: protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + | protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IEvaluation + >, + callback?: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + | protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IEvaluation + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluation[], + protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest | null, + protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchEvaluations(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Evaluation search parent (project ID). Format: + * "projects/{project_id}" + * @param {string} [request.filter] + * Optional. To search evaluations, you can filter by the following: + * + * * evaluation_job.evaluation_job_id (the last part of + * {@link google.cloud.datalabeling.v1beta1.EvaluationJob.name|EvaluationJob.name}) + * * evaluation_job.model_id (the {model_name} portion + * of {@link google.cloud.datalabeling.v1beta1.EvaluationJob.model_version|EvaluationJob.modelVersion}) + * * evaluation_job.evaluation_job_run_time_start (Minimum + * threshold for the + * {@link google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time|evaluationJobRunTime} that created + * the evaluation) + * * evaluation_job.evaluation_job_run_time_end (Maximum + * threshold for the + * {@link google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time|evaluationJobRunTime} that created + * the evaluation) + * * evaluation_job.job_state ({@link google.cloud.datalabeling.v1beta1.EvaluationJob.state|EvaluationJob.state}) + * * annotation_spec.display_name (the Evaluation contains a + * metric for the annotation spec with this + * {@link google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name|displayName}) + * + * To filter by multiple critiera, use the `AND` operator or the `OR` + * operator. The following examples shows a string that filters by several + * critiera: + * + * "evaluation_job.evaluation_job_id = + * {evaluation_job_id} AND evaluation_job.model_id = + * {model_name} AND + * evaluation_job.evaluation_job_run_time_start = + * {timestamp_1} AND + * evaluation_job.evaluation_job_run_time_end = + * {timestamp_2} AND annotation_spec.display_name = + * {display_name}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.next_page_token|nextPageToken} of the response + * to a previous search request. + * + * If you don't specify this field, the API call requests the first page of + * the search. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Evaluation]{@link google.cloud.datalabeling.v1beta1.Evaluation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchEvaluationsStream( + request?: protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['searchEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchEvaluations.createStream( + this.innerApiCalls.searchEvaluations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchEvaluations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Evaluation search parent (project ID). Format: + * "projects/{project_id}" + * @param {string} [request.filter] + * Optional. To search evaluations, you can filter by the following: + * + * * evaluation_job.evaluation_job_id (the last part of + * {@link google.cloud.datalabeling.v1beta1.EvaluationJob.name|EvaluationJob.name}) + * * evaluation_job.model_id (the {model_name} portion + * of {@link google.cloud.datalabeling.v1beta1.EvaluationJob.model_version|EvaluationJob.modelVersion}) + * * evaluation_job.evaluation_job_run_time_start (Minimum + * threshold for the + * {@link google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time|evaluationJobRunTime} that created + * the evaluation) + * * evaluation_job.evaluation_job_run_time_end (Maximum + * threshold for the + * {@link google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time|evaluationJobRunTime} that created + * the evaluation) + * * evaluation_job.job_state ({@link google.cloud.datalabeling.v1beta1.EvaluationJob.state|EvaluationJob.state}) + * * annotation_spec.display_name (the Evaluation contains a + * metric for the annotation spec with this + * {@link google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name|displayName}) + * + * To filter by multiple critiera, use the `AND` operator or the `OR` + * operator. The following examples shows a string that filters by several + * critiera: + * + * "evaluation_job.evaluation_job_id = + * {evaluation_job_id} AND evaluation_job.model_id = + * {model_name} AND + * evaluation_job.evaluation_job_run_time_start = + * {timestamp_1} AND + * evaluation_job.evaluation_job_run_time_end = + * {timestamp_2} AND annotation_spec.display_name = + * {display_name}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * {@link google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.next_page_token|nextPageToken} of the response + * to a previous search request. + * + * If you don't specify this field, the API call requests the first page of + * the search. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Evaluation]{@link google.cloud.datalabeling.v1beta1.Evaluation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.search_evaluations.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_SearchEvaluations_async + */ + searchEvaluationsAsync( + request?: protos.google.cloud.datalabeling.v1beta1.ISearchEvaluationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['searchEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchEvaluations.asyncIterate( + this.innerApiCalls['searchEvaluations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Searches example comparisons from an evaluation. The return format is a + * list of example comparisons that show ground truth and prediction(s) for + * a single input. Search by providing an evaluation ID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the {@link google.cloud.datalabeling.v1beta1.Evaluation|Evaluation} resource to search for example + * comparisons from. Format: + * + * "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * {@link SearchExampleComparisons.next_page_token|nextPageToken} of the response + * to a previous search rquest. + * + * If you don't specify this field, the API call requests the first page of + * the search. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ExampleComparison]{@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchExampleComparisonsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchExampleComparisons( + request?: protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison[], + protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest | null, + protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse + ] + >; + searchExampleComparisons( + request: protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + | protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison + > + ): void; + searchExampleComparisons( + request: protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + | protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison + > + ): void; + searchExampleComparisons( + request?: protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + | protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison + >, + callback?: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + | protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison[], + protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest | null, + protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchExampleComparisons( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the {@link google.cloud.datalabeling.v1beta1.Evaluation|Evaluation} resource to search for example + * comparisons from. Format: + * + * "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * {@link SearchExampleComparisons.next_page_token|nextPageToken} of the response + * to a previous search rquest. + * + * If you don't specify this field, the API call requests the first page of + * the search. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ExampleComparison]{@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchExampleComparisonsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchExampleComparisonsStream( + request?: protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['searchExampleComparisons']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchExampleComparisons.createStream( + this.innerApiCalls.searchExampleComparisons as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchExampleComparisons`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the {@link google.cloud.datalabeling.v1beta1.Evaluation|Evaluation} resource to search for example + * comparisons from. Format: + * + * "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * {@link SearchExampleComparisons.next_page_token|nextPageToken} of the response + * to a previous search rquest. + * + * If you don't specify this field, the API call requests the first page of + * the search. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ExampleComparison]{@link google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.search_example_comparisons.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_SearchExampleComparisons_async + */ + searchExampleComparisonsAsync( + request?: protos.google.cloud.datalabeling.v1beta1.ISearchExampleComparisonsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['searchExampleComparisons']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchExampleComparisons.asyncIterate( + this.innerApiCalls['searchExampleComparisons'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all evaluation jobs within a project with possible filters. + * Pagination is supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Evaluation job resource parent. Format: + * "projects/{project_id}" + * @param {string} [request.filter] + * Optional. You can filter the jobs to list by model_id (also known as + * model_name, as described in + * {@link google.cloud.datalabeling.v1beta1.EvaluationJob.model_version|EvaluationJob.modelVersion}) or by + * evaluation job state (as described in {@link google.cloud.datalabeling.v1beta1.EvaluationJob.state|EvaluationJob.state}). To filter + * by both criteria, use the `AND` operator or the `OR` operator. For example, + * you can use the following string for your filter: + * "evaluation_job.model_id = {model_name} AND + * evaluation_job.state = {evaluation_job_state}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.next_page_token|nextPageToken} in the response + * to the previous request. The request returns the first page if this is + * empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [EvaluationJob]{@link google.cloud.datalabeling.v1beta1.EvaluationJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEvaluationJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEvaluationJobs( + request?: protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob[], + protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse + ] + >; + listEvaluationJobs( + request: protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob + > + ): void; + listEvaluationJobs( + request: protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + callback: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob + > + ): void; + listEvaluationJobs( + request?: protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob + >, + callback?: PaginationCallback< + protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + | protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse + | null + | undefined, + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob + > + ): Promise< + [ + protos.google.cloud.datalabeling.v1beta1.IEvaluationJob[], + protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest | null, + protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listEvaluationJobs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Evaluation job resource parent. Format: + * "projects/{project_id}" + * @param {string} [request.filter] + * Optional. You can filter the jobs to list by model_id (also known as + * model_name, as described in + * {@link google.cloud.datalabeling.v1beta1.EvaluationJob.model_version|EvaluationJob.modelVersion}) or by + * evaluation job state (as described in {@link google.cloud.datalabeling.v1beta1.EvaluationJob.state|EvaluationJob.state}). To filter + * by both criteria, use the `AND` operator or the `OR` operator. For example, + * you can use the following string for your filter: + * "evaluation_job.model_id = {model_name} AND + * evaluation_job.state = {evaluation_job_state}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.next_page_token|nextPageToken} in the response + * to the previous request. The request returns the first page if this is + * empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [EvaluationJob]{@link google.cloud.datalabeling.v1beta1.EvaluationJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listEvaluationJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEvaluationJobsStream( + request?: protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEvaluationJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEvaluationJobs.createStream( + this.innerApiCalls.listEvaluationJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listEvaluationJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Evaluation job resource parent. Format: + * "projects/{project_id}" + * @param {string} [request.filter] + * Optional. You can filter the jobs to list by model_id (also known as + * model_name, as described in + * {@link google.cloud.datalabeling.v1beta1.EvaluationJob.model_version|EvaluationJob.modelVersion}) or by + * evaluation job state (as described in {@link google.cloud.datalabeling.v1beta1.EvaluationJob.state|EvaluationJob.state}). To filter + * by both criteria, use the `AND` operator or the `OR` operator. For example, + * you can use the following string for your filter: + * "evaluation_job.model_id = {model_name} AND + * evaluation_job.state = {evaluation_job_state}" + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer results than + * requested. Default value is 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results for the server to return. + * Typically obtained by the + * {@link google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.next_page_token|nextPageToken} in the response + * to the previous request. The request returns the first page if this is + * empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [EvaluationJob]{@link google.cloud.datalabeling.v1beta1.EvaluationJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_labeling_service.list_evaluation_jobs.js + * region_tag:datalabeling_v1beta1_generated_DataLabelingService_ListEvaluationJobs_async + */ + listEvaluationJobsAsync( + request?: protos.google.cloud.datalabeling.v1beta1.IListEvaluationJobsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEvaluationJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEvaluationJobs.asyncIterate( + this.innerApiCalls['listEvaluationJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotatedDataset resource name string. + * + * @param {string} project + * @param {string} dataset + * @param {string} annotated_dataset + * @returns {string} Resource name string. + */ + annotatedDatasetPath( + project: string, + dataset: string, + annotatedDataset: string + ) { + return this.pathTemplates.annotatedDatasetPathTemplate.render({ + project: project, + dataset: dataset, + annotated_dataset: annotatedDataset, + }); + } + + /** + * Parse the project from AnnotatedDataset resource. + * + * @param {string} annotatedDatasetName + * A fully-qualified path representing AnnotatedDataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotatedDatasetName(annotatedDatasetName: string) { + return this.pathTemplates.annotatedDatasetPathTemplate.match( + annotatedDatasetName + ).project; + } + + /** + * Parse the dataset from AnnotatedDataset resource. + * + * @param {string} annotatedDatasetName + * A fully-qualified path representing AnnotatedDataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotatedDatasetName(annotatedDatasetName: string) { + return this.pathTemplates.annotatedDatasetPathTemplate.match( + annotatedDatasetName + ).dataset; + } + + /** + * Parse the annotated_dataset from AnnotatedDataset resource. + * + * @param {string} annotatedDatasetName + * A fully-qualified path representing AnnotatedDataset resource. + * @returns {string} A string representing the annotated_dataset. + */ + matchAnnotatedDatasetFromAnnotatedDatasetName(annotatedDatasetName: string) { + return this.pathTemplates.annotatedDatasetPathTemplate.match( + annotatedDatasetName + ).annotated_dataset; + } + + /** + * Return a fully-qualified annotationSpecSet resource name string. + * + * @param {string} project + * @param {string} annotation_spec_set + * @returns {string} Resource name string. + */ + annotationSpecSetPath(project: string, annotationSpecSet: string) { + return this.pathTemplates.annotationSpecSetPathTemplate.render({ + project: project, + annotation_spec_set: annotationSpecSet, + }); + } + + /** + * Parse the project from AnnotationSpecSet resource. + * + * @param {string} annotationSpecSetName + * A fully-qualified path representing AnnotationSpecSet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecSetName(annotationSpecSetName: string) { + return this.pathTemplates.annotationSpecSetPathTemplate.match( + annotationSpecSetName + ).project; + } + + /** + * Parse the annotation_spec_set from AnnotationSpecSet resource. + * + * @param {string} annotationSpecSetName + * A fully-qualified path representing AnnotationSpecSet resource. + * @returns {string} A string representing the annotation_spec_set. + */ + matchAnnotationSpecSetFromAnnotationSpecSetName( + annotationSpecSetName: string + ) { + return this.pathTemplates.annotationSpecSetPathTemplate.match( + annotationSpecSetName + ).annotation_spec_set; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project: string, dataset: string, dataItem: string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName) + .data_item; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified evaluation resource name string. + * + * @param {string} project + * @param {string} dataset + * @param {string} evaluation + * @returns {string} Resource name string. + */ + evaluationPath(project: string, dataset: string, evaluation: string) { + return this.pathTemplates.evaluationPathTemplate.render({ + project: project, + dataset: dataset, + evaluation: evaluation, + }); + } + + /** + * Parse the project from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName) + .project; + } + + /** + * Parse the dataset from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName) + .dataset; + } + + /** + * Parse the evaluation from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName) + .evaluation; + } + + /** + * Return a fully-qualified evaluationJob resource name string. + * + * @param {string} project + * @param {string} evaluation_job + * @returns {string} Resource name string. + */ + evaluationJobPath(project: string, evaluationJob: string) { + return this.pathTemplates.evaluationJobPathTemplate.render({ + project: project, + evaluation_job: evaluationJob, + }); + } + + /** + * Parse the project from EvaluationJob resource. + * + * @param {string} evaluationJobName + * A fully-qualified path representing EvaluationJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationJobName(evaluationJobName: string) { + return this.pathTemplates.evaluationJobPathTemplate.match(evaluationJobName) + .project; + } + + /** + * Parse the evaluation_job from EvaluationJob resource. + * + * @param {string} evaluationJobName + * A fully-qualified path representing EvaluationJob resource. + * @returns {string} A string representing the evaluation_job. + */ + matchEvaluationJobFromEvaluationJobName(evaluationJobName: string) { + return this.pathTemplates.evaluationJobPathTemplate.match(evaluationJobName) + .evaluation_job; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} dataset + * @param {string} annotated_dataset + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath( + project: string, + dataset: string, + annotatedDataset: string, + example: string + ) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + dataset: dataset, + annotated_dataset: annotatedDataset, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the dataset from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).dataset; + } + + /** + * Parse the annotated_dataset from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the annotated_dataset. + */ + matchAnnotatedDatasetFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName) + .annotated_dataset; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified instruction resource name string. + * + * @param {string} project + * @param {string} instruction + * @returns {string} Resource name string. + */ + instructionPath(project: string, instruction: string) { + return this.pathTemplates.instructionPathTemplate.render({ + project: project, + instruction: instruction, + }); + } + + /** + * Parse the project from Instruction resource. + * + * @param {string} instructionName + * A fully-qualified path representing Instruction resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstructionName(instructionName: string) { + return this.pathTemplates.instructionPathTemplate.match(instructionName) + .project; + } + + /** + * Parse the instruction from Instruction resource. + * + * @param {string} instructionName + * A fully-qualified path representing Instruction resource. + * @returns {string} A string representing the instruction. + */ + matchInstructionFromInstructionName(instructionName: string) { + return this.pathTemplates.instructionPathTemplate.match(instructionName) + .instruction; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.dataLabelingServiceStub && !this._terminated) { + return this.dataLabelingServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_client_config.json b/packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_client_config.json new file mode 100644 index 00000000000..c67508efe79 --- /dev/null +++ b/packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_client_config.json @@ -0,0 +1,204 @@ +{ + "interfaces": { + "google.cloud.datalabeling.v1beta1.DataLabelingService": { + "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 + }, + "71ca22c74d2828b200f9ff1cc285a8beb96cc2af": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDataset": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataset": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "ListDatasets": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "DeleteDataset": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "ImportData": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportData": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "GetDataItem": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "ListDataItems": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "GetAnnotatedDataset": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "ListAnnotatedDatasets": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "DeleteAnnotatedDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LabelImage": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LabelVideo": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LabelText": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetExample": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "ListExamples": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "CreateAnnotationSpecSet": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAnnotationSpecSet": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "ListAnnotationSpecSets": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "DeleteAnnotationSpecSet": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "CreateInstruction": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstruction": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "ListInstructions": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "DeleteInstruction": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "GetEvaluation": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "SearchEvaluations": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "SearchExampleComparisons": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateEvaluationJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEvaluationJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEvaluationJob": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "PauseEvaluationJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResumeEvaluationJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEvaluationJob": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "ListEvaluationJobs": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + } + } + } + } +} diff --git a/packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_proto_list.json b/packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_proto_list.json new file mode 100644 index 00000000000..a5ac3d5b4aa --- /dev/null +++ b/packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/datalabeling/v1beta1/annotation.proto", + "../../protos/google/cloud/datalabeling/v1beta1/annotation_spec_set.proto", + "../../protos/google/cloud/datalabeling/v1beta1/data_labeling_service.proto", + "../../protos/google/cloud/datalabeling/v1beta1/data_payloads.proto", + "../../protos/google/cloud/datalabeling/v1beta1/dataset.proto", + "../../protos/google/cloud/datalabeling/v1beta1/evaluation.proto", + "../../protos/google/cloud/datalabeling/v1beta1/evaluation_job.proto", + "../../protos/google/cloud/datalabeling/v1beta1/human_annotation_config.proto", + "../../protos/google/cloud/datalabeling/v1beta1/instruction.proto", + "../../protos/google/cloud/datalabeling/v1beta1/operations.proto" +] diff --git a/packages/google-cloud-datalabeling/src/v1beta1/gapic_metadata.json b/packages/google-cloud-datalabeling/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..f5ab0ad7e89 --- /dev/null +++ b/packages/google-cloud-datalabeling/src/v1beta1/gapic_metadata.json @@ -0,0 +1,399 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.datalabeling.v1beta1", + "libraryPackage": "@google-cloud/datalabeling", + "services": { + "DataLabelingService": { + "clients": { + "grpc": { + "libraryClient": "DataLabelingServiceClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "GetDataItem": { + "methods": [ + "getDataItem" + ] + }, + "GetAnnotatedDataset": { + "methods": [ + "getAnnotatedDataset" + ] + }, + "DeleteAnnotatedDataset": { + "methods": [ + "deleteAnnotatedDataset" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "CreateAnnotationSpecSet": { + "methods": [ + "createAnnotationSpecSet" + ] + }, + "GetAnnotationSpecSet": { + "methods": [ + "getAnnotationSpecSet" + ] + }, + "DeleteAnnotationSpecSet": { + "methods": [ + "deleteAnnotationSpecSet" + ] + }, + "GetInstruction": { + "methods": [ + "getInstruction" + ] + }, + "DeleteInstruction": { + "methods": [ + "deleteInstruction" + ] + }, + "GetEvaluation": { + "methods": [ + "getEvaluation" + ] + }, + "CreateEvaluationJob": { + "methods": [ + "createEvaluationJob" + ] + }, + "UpdateEvaluationJob": { + "methods": [ + "updateEvaluationJob" + ] + }, + "GetEvaluationJob": { + "methods": [ + "getEvaluationJob" + ] + }, + "PauseEvaluationJob": { + "methods": [ + "pauseEvaluationJob" + ] + }, + "ResumeEvaluationJob": { + "methods": [ + "resumeEvaluationJob" + ] + }, + "DeleteEvaluationJob": { + "methods": [ + "deleteEvaluationJob" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "LabelImage": { + "methods": [ + "labelImage" + ] + }, + "LabelVideo": { + "methods": [ + "labelVideo" + ] + }, + "LabelText": { + "methods": [ + "labelText" + ] + }, + "CreateInstruction": { + "methods": [ + "createInstruction" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListDataItems": { + "methods": [ + "listDataItems", + "listDataItemsStream", + "listDataItemsAsync" + ] + }, + "ListAnnotatedDatasets": { + "methods": [ + "listAnnotatedDatasets", + "listAnnotatedDatasetsStream", + "listAnnotatedDatasetsAsync" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + }, + "ListAnnotationSpecSets": { + "methods": [ + "listAnnotationSpecSets", + "listAnnotationSpecSetsStream", + "listAnnotationSpecSetsAsync" + ] + }, + "ListInstructions": { + "methods": [ + "listInstructions", + "listInstructionsStream", + "listInstructionsAsync" + ] + }, + "SearchEvaluations": { + "methods": [ + "searchEvaluations", + "searchEvaluationsStream", + "searchEvaluationsAsync" + ] + }, + "SearchExampleComparisons": { + "methods": [ + "searchExampleComparisons", + "searchExampleComparisonsStream", + "searchExampleComparisonsAsync" + ] + }, + "ListEvaluationJobs": { + "methods": [ + "listEvaluationJobs", + "listEvaluationJobsStream", + "listEvaluationJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataLabelingServiceClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "GetDataItem": { + "methods": [ + "getDataItem" + ] + }, + "GetAnnotatedDataset": { + "methods": [ + "getAnnotatedDataset" + ] + }, + "DeleteAnnotatedDataset": { + "methods": [ + "deleteAnnotatedDataset" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "CreateAnnotationSpecSet": { + "methods": [ + "createAnnotationSpecSet" + ] + }, + "GetAnnotationSpecSet": { + "methods": [ + "getAnnotationSpecSet" + ] + }, + "DeleteAnnotationSpecSet": { + "methods": [ + "deleteAnnotationSpecSet" + ] + }, + "GetInstruction": { + "methods": [ + "getInstruction" + ] + }, + "DeleteInstruction": { + "methods": [ + "deleteInstruction" + ] + }, + "GetEvaluation": { + "methods": [ + "getEvaluation" + ] + }, + "CreateEvaluationJob": { + "methods": [ + "createEvaluationJob" + ] + }, + "UpdateEvaluationJob": { + "methods": [ + "updateEvaluationJob" + ] + }, + "GetEvaluationJob": { + "methods": [ + "getEvaluationJob" + ] + }, + "PauseEvaluationJob": { + "methods": [ + "pauseEvaluationJob" + ] + }, + "ResumeEvaluationJob": { + "methods": [ + "resumeEvaluationJob" + ] + }, + "DeleteEvaluationJob": { + "methods": [ + "deleteEvaluationJob" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "LabelImage": { + "methods": [ + "labelImage" + ] + }, + "LabelVideo": { + "methods": [ + "labelVideo" + ] + }, + "LabelText": { + "methods": [ + "labelText" + ] + }, + "CreateInstruction": { + "methods": [ + "createInstruction" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListDataItems": { + "methods": [ + "listDataItems", + "listDataItemsStream", + "listDataItemsAsync" + ] + }, + "ListAnnotatedDatasets": { + "methods": [ + "listAnnotatedDatasets", + "listAnnotatedDatasetsStream", + "listAnnotatedDatasetsAsync" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + }, + "ListAnnotationSpecSets": { + "methods": [ + "listAnnotationSpecSets", + "listAnnotationSpecSetsStream", + "listAnnotationSpecSetsAsync" + ] + }, + "ListInstructions": { + "methods": [ + "listInstructions", + "listInstructionsStream", + "listInstructionsAsync" + ] + }, + "SearchEvaluations": { + "methods": [ + "searchEvaluations", + "searchEvaluationsStream", + "searchEvaluationsAsync" + ] + }, + "SearchExampleComparisons": { + "methods": [ + "searchExampleComparisons", + "searchExampleComparisonsStream", + "searchExampleComparisonsAsync" + ] + }, + "ListEvaluationJobs": { + "methods": [ + "listEvaluationJobs", + "listEvaluationJobsStream", + "listEvaluationJobsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-datalabeling/src/v1beta1/index.ts b/packages/google-cloud-datalabeling/src/v1beta1/index.ts new file mode 100644 index 00000000000..810510262b8 --- /dev/null +++ b/packages/google-cloud-datalabeling/src/v1beta1/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 {DataLabelingServiceClient} from './data_labeling_service_client'; diff --git a/packages/google-cloud-datalabeling/system-test/fixtures/sample/src/index.js b/packages/google-cloud-datalabeling/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..04ac82a56c7 --- /dev/null +++ b/packages/google-cloud-datalabeling/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 datalabeling = require('@google-cloud/datalabeling'); + +function main() { + const dataLabelingServiceClient = + new datalabeling.DataLabelingServiceClient(); +} + +main(); diff --git a/packages/google-cloud-datalabeling/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-datalabeling/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..00ca0a1be31 --- /dev/null +++ b/packages/google-cloud-datalabeling/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 {DataLabelingServiceClient} from '@google-cloud/datalabeling'; + +// check that the client class type name can be used +function doStuffWithDataLabelingServiceClient( + client: DataLabelingServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataLabelingServiceClient = new DataLabelingServiceClient(); + doStuffWithDataLabelingServiceClient(dataLabelingServiceClient); +} + +main(); diff --git a/packages/google-cloud-datalabeling/system-test/install.ts b/packages/google-cloud-datalabeling/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-datalabeling/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-datalabeling/test/gapic_data_labeling_service_v1beta1.ts b/packages/google-cloud-datalabeling/test/gapic_data_labeling_service_v1beta1.ts new file mode 100644 index 00000000000..63b44235d1b --- /dev/null +++ b/packages/google-cloud-datalabeling/test/gapic_data_labeling_service_v1beta1.ts @@ -0,0 +1,7690 @@ +// 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 datalabelingserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.DataLabelingServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + datalabelingserviceModule.v1beta1.DataLabelingServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + datalabelingserviceModule.v1beta1.DataLabelingServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + datalabelingserviceModule.v1beta1.DataLabelingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataLabelingServiceStub, undefined); + await client.initialize(); + assert(client.dataLabelingServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataLabelingServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataLabelingServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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 datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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('createDataset', () => { + it('invokes createDataset without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ); + client.innerApiCalls.createDataset = stubSimpleCall(expectedResponse); + const [response] = await client.createDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ); + client.innerApiCalls.createDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDataset(request), expectedError); + }); + }); + + describe('getDataset', () => { + it('invokes getDataset without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ); + client.innerApiCalls.getDataset = stubSimpleCall(expectedResponse); + const [response] = await client.getDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ); + client.innerApiCalls.getDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataset(request), expectedError); + }); + }); + + describe('deleteDataset', () => { + it('invokes deleteDataset without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataset = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataset( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDataset(request), expectedError); + }); + }); + + describe('getDataItem', () => { + it('invokes getDataItem without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetDataItemRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetDataItemRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ); + client.innerApiCalls.getDataItem = stubSimpleCall(expectedResponse); + const [response] = await client.getDataItem(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataItem as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataItem as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataItem without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetDataItemRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetDataItemRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ); + client.innerApiCalls.getDataItem = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataItem( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IDataItem | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataItem as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataItem as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataItem with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetDataItemRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetDataItemRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataItem = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDataItem(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataItem as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataItem as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataItem with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetDataItemRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetDataItemRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataItem(request), expectedError); + }); + }); + + describe('getAnnotatedDataset', () => { + it('invokes getAnnotatedDataset without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ); + client.innerApiCalls.getAnnotatedDataset = + stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotatedDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotatedDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotatedDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotatedDataset without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ); + client.innerApiCalls.getAnnotatedDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotatedDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotatedDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotatedDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotatedDataset with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotatedDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAnnotatedDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAnnotatedDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotatedDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotatedDataset with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnnotatedDataset(request), expectedError); + }); + }); + + describe('deleteAnnotatedDataset', () => { + it('invokes deleteAnnotatedDataset without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAnnotatedDataset = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteAnnotatedDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAnnotatedDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnnotatedDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnnotatedDataset without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAnnotatedDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAnnotatedDataset( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAnnotatedDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnnotatedDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnnotatedDataset with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAnnotatedDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteAnnotatedDataset(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteAnnotatedDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnnotatedDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnnotatedDataset with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteAnnotatedDataset(request), + expectedError + ); + }); + }); + + describe('getExample', () => { + it('invokes getExample without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetExampleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetExampleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ); + client.innerApiCalls.getExample = stubSimpleCall(expectedResponse); + const [response] = await client.getExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetExampleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetExampleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ); + client.innerApiCalls.getExample = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExample( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IExample | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetExampleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetExampleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExample = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getExample(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExample as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetExampleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetExampleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getExample(request), expectedError); + }); + }); + + describe('createAnnotationSpecSet', () => { + it('invokes createAnnotationSpecSet without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ); + client.innerApiCalls.createAnnotationSpecSet = + stubSimpleCall(expectedResponse); + const [response] = await client.createAnnotationSpecSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAnnotationSpecSet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotationSpecSet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnnotationSpecSet without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ); + client.innerApiCalls.createAnnotationSpecSet = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAnnotationSpecSet( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAnnotationSpecSet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotationSpecSet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnnotationSpecSet with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnnotationSpecSet = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createAnnotationSpecSet(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createAnnotationSpecSet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotationSpecSet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnnotationSpecSet with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createAnnotationSpecSet(request), + expectedError + ); + }); + }); + + describe('getAnnotationSpecSet', () => { + it('invokes getAnnotationSpecSet without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ); + client.innerApiCalls.getAnnotationSpecSet = + stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotationSpecSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpecSet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpecSet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpecSet without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ); + client.innerApiCalls.getAnnotationSpecSet = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotationSpecSet( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpecSet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpecSet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpecSet with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotationSpecSet = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAnnotationSpecSet(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpecSet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpecSet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpecSet with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnnotationSpecSet(request), expectedError); + }); + }); + + describe('deleteAnnotationSpecSet', () => { + it('invokes deleteAnnotationSpecSet without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAnnotationSpecSet = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteAnnotationSpecSet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAnnotationSpecSet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnnotationSpecSet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnnotationSpecSet without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAnnotationSpecSet = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAnnotationSpecSet( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAnnotationSpecSet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnnotationSpecSet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnnotationSpecSet with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAnnotationSpecSet = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteAnnotationSpecSet(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteAnnotationSpecSet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnnotationSpecSet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnnotationSpecSet with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteAnnotationSpecSet(request), + expectedError + ); + }); + }); + + describe('getInstruction', () => { + it('invokes getInstruction without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetInstructionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ); + client.innerApiCalls.getInstruction = stubSimpleCall(expectedResponse); + const [response] = await client.getInstruction(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstruction without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetInstructionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ); + client.innerApiCalls.getInstruction = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstruction( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IInstruction | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstruction with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetInstructionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstruction = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstruction(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstruction with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetInstructionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstruction(request), expectedError); + }); + }); + + describe('deleteInstruction', () => { + it('invokes deleteInstruction without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteInstruction = stubSimpleCall(expectedResponse); + const [response] = await client.deleteInstruction(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstruction without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteInstruction = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstruction( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstruction with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstruction = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstruction(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstruction with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteInstruction(request), expectedError); + }); + }); + + describe('getEvaluation', () => { + it('invokes getEvaluation without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ); + client.innerApiCalls.getEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.getEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ); + client.innerApiCalls.getEvaluation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvaluation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IEvaluation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvaluation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getEvaluation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEvaluation(request), expectedError); + }); + }); + + describe('createEvaluationJob', () => { + it('invokes createEvaluationJob without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ); + client.innerApiCalls.createEvaluationJob = + stubSimpleCall(expectedResponse); + const [response] = await client.createEvaluationJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluationJob without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ); + client.innerApiCalls.createEvaluationJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEvaluationJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IEvaluationJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluationJob with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEvaluationJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createEvaluationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluationJob with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createEvaluationJob(request), expectedError); + }); + }); + + describe('updateEvaluationJob', () => { + it('invokes updateEvaluationJob without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest() + ); + request.evaluationJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest', + ['evaluationJob', 'name'] + ); + request.evaluationJob.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation_job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ); + client.innerApiCalls.updateEvaluationJob = + stubSimpleCall(expectedResponse); + const [response] = await client.updateEvaluationJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluationJob without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest() + ); + request.evaluationJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest', + ['evaluationJob', 'name'] + ); + request.evaluationJob.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation_job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ); + client.innerApiCalls.updateEvaluationJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEvaluationJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IEvaluationJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluationJob with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest() + ); + request.evaluationJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest', + ['evaluationJob', 'name'] + ); + request.evaluationJob.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation_job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEvaluationJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateEvaluationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluationJob with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest() + ); + request.evaluationJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest', + ['evaluationJob', 'name'] + ); + request.evaluationJob.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateEvaluationJob(request), expectedError); + }); + }); + + describe('getEvaluationJob', () => { + it('invokes getEvaluationJob without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ); + client.innerApiCalls.getEvaluationJob = stubSimpleCall(expectedResponse); + const [response] = await client.getEvaluationJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationJob without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ); + client.innerApiCalls.getEvaluationJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvaluationJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IEvaluationJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationJob with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvaluationJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getEvaluationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationJob with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEvaluationJob(request), expectedError); + }); + }); + + describe('pauseEvaluationJob', () => { + it('invokes pauseEvaluationJob without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.pauseEvaluationJob = + stubSimpleCall(expectedResponse); + const [response] = await client.pauseEvaluationJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pauseEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseEvaluationJob without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.pauseEvaluationJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pauseEvaluationJob( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pauseEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseEvaluationJob with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseEvaluationJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.pauseEvaluationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.pauseEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseEvaluationJob with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pauseEvaluationJob(request), expectedError); + }); + }); + + describe('resumeEvaluationJob', () => { + it('invokes resumeEvaluationJob without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.resumeEvaluationJob = + stubSimpleCall(expectedResponse); + const [response] = await client.resumeEvaluationJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumeEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeEvaluationJob without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.resumeEvaluationJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeEvaluationJob( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumeEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeEvaluationJob with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeEvaluationJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.resumeEvaluationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.resumeEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeEvaluationJob with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.resumeEvaluationJob(request), expectedError); + }); + }); + + describe('deleteEvaluationJob', () => { + it('invokes deleteEvaluationJob without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluationJob = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteEvaluationJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationJob without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluationJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEvaluationJob( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationJob with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvaluationJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteEvaluationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEvaluationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvaluationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationJob with closed client', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteEvaluationJob(request), expectedError); + }); + }); + + describe('importData', () => { + it('invokes importData without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importData = stubLongRunningCall(expectedResponse); + const [operation] = await client.importData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importData = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importData( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IImportDataOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData with call error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.importData(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData with LRO error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.importData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportDataProgress without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkImportDataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportDataProgress with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkImportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportData', () => { + it('invokes exportData without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportData = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportData = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportData( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationResponse, + protos.google.cloud.datalabeling.v1beta1.IExportDataOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData with call error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportData(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData with LRO error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportDataProgress without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkExportDataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportDataProgress with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkExportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('labelImage', () => { + it('invokes labelImage without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelImageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelImageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.labelImage = stubLongRunningCall(expectedResponse); + const [operation] = await client.labelImage(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.labelImage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelImage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes labelImage without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelImageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelImageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.labelImage = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.labelImage( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.labelImage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelImage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes labelImage with call error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelImageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelImageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.labelImage = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.labelImage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.labelImage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelImage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes labelImage with LRO error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelImageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelImageRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.labelImage = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.labelImage(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.labelImage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelImage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkLabelImageProgress without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkLabelImageProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLabelImageProgress with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkLabelImageProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('labelVideo', () => { + it('invokes labelVideo without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelVideoRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelVideoRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.labelVideo = stubLongRunningCall(expectedResponse); + const [operation] = await client.labelVideo(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.labelVideo as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelVideo as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes labelVideo without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelVideoRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelVideoRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.labelVideo = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.labelVideo( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.labelVideo as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelVideo as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes labelVideo with call error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelVideoRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelVideoRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.labelVideo = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.labelVideo(request), expectedError); + const actualRequest = ( + client.innerApiCalls.labelVideo as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelVideo as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes labelVideo with LRO error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelVideoRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelVideoRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.labelVideo = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.labelVideo(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.labelVideo as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelVideo as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkLabelVideoProgress without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkLabelVideoProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLabelVideoProgress with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkLabelVideoProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('labelText', () => { + it('invokes labelText without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.labelText = stubLongRunningCall(expectedResponse); + const [operation] = await client.labelText(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.labelText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes labelText without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.labelText = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.labelText( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset, + protos.google.cloud.datalabeling.v1beta1.ILabelOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.labelText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes labelText with call error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.labelText = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.labelText(request), expectedError); + const actualRequest = ( + client.innerApiCalls.labelText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes labelText with LRO error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.LabelTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.LabelTextRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.labelText = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.labelText(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.labelText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.labelText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkLabelTextProgress without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkLabelTextProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLabelTextProgress with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkLabelTextProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createInstruction', () => { + it('invokes createInstruction without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateInstructionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstruction = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstruction(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstruction without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateInstructionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstruction = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstruction( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + protos.google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datalabeling.v1beta1.IInstruction, + protos.google.cloud.datalabeling.v1beta1.ICreateInstructionMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstruction with call error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateInstructionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstruction = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstruction(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstruction with LRO error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.CreateInstructionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.CreateInstructionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstruction = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createInstruction(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstruction as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstruction as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstructionProgress without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkCreateInstructionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstructionProgress with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + 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.checkCreateInstructionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDatasets', () => { + it('invokes listDatasets without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + ]; + client.innerApiCalls.listDatasets = stubSimpleCall(expectedResponse); + const [response] = await client.listDatasets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + ]; + client.innerApiCalls.listDatasets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatasets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IDataset[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatasets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDatasets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasetsStream without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + ]; + client.descriptors.page.listDatasets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.Dataset[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.Dataset) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request) + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatasetsStream with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.Dataset[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.Dataset) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request) + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatasets without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Dataset() + ), + ]; + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datalabeling.v1beta1.IDataset[] = []; + const iterable = client.listDatasetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatasets with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatasetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datalabeling.v1beta1.IDataset[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDataItems', () => { + it('invokes listDataItems without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDataItemsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDataItemsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + ]; + client.innerApiCalls.listDataItems = stubSimpleCall(expectedResponse); + const [response] = await client.listDataItems(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataItems without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDataItemsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDataItemsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + ]; + client.innerApiCalls.listDataItems = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataItems( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IDataItem[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataItems with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDataItemsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDataItemsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataItems = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDataItems(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataItemsStream without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDataItemsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDataItemsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + ]; + client.descriptors.page.listDataItems.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.DataItem[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.DataItem) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataItems, request) + ); + assert( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDataItemsStream with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDataItemsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDataItemsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataItems.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.DataItem[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.DataItem) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataItems, request) + ); + assert( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataItems without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDataItemsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDataItemsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.DataItem() + ), + ]; + client.descriptors.page.listDataItems.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datalabeling.v1beta1.IDataItem[] = + []; + const iterable = client.listDataItemsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataItems.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataItems with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListDataItemsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListDataItemsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataItems.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataItemsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datalabeling.v1beta1.IDataItem[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataItems.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAnnotatedDatasets', () => { + it('invokes listAnnotatedDatasets without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + ]; + client.innerApiCalls.listAnnotatedDatasets = + stubSimpleCall(expectedResponse); + const [response] = await client.listAnnotatedDatasets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAnnotatedDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotatedDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnnotatedDatasets without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + ]; + client.innerApiCalls.listAnnotatedDatasets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAnnotatedDatasets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAnnotatedDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotatedDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnnotatedDatasets with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnnotatedDatasets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listAnnotatedDatasets(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listAnnotatedDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotatedDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnnotatedDatasetsStream without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + ]; + client.descriptors.page.listAnnotatedDatasets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAnnotatedDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listAnnotatedDatasets + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAnnotatedDatasets, request) + ); + assert( + ( + client.descriptors.page.listAnnotatedDatasets + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAnnotatedDatasetsStream with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnnotatedDatasets.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAnnotatedDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listAnnotatedDatasets + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAnnotatedDatasets, request) + ); + assert( + ( + client.descriptors.page.listAnnotatedDatasets + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAnnotatedDatasets without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotatedDataset() + ), + ]; + client.descriptors.page.listAnnotatedDatasets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset[] = + []; + const iterable = client.listAnnotatedDatasetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAnnotatedDatasets + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listAnnotatedDatasets + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAnnotatedDatasets with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnnotatedDatasets.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAnnotatedDatasetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datalabeling.v1beta1.IAnnotatedDataset[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAnnotatedDatasets + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listAnnotatedDatasets + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listExamples', () => { + it('invokes listExamples without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListExamplesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + ]; + client.innerApiCalls.listExamples = stubSimpleCall(expectedResponse); + const [response] = await client.listExamples(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListExamplesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + ]; + client.innerApiCalls.listExamples = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExamples( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datalabeling.v1beta1.IExample[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListExamplesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExamples = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listExamples(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamplesStream without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListExamplesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + ]; + client.descriptors.page.listExamples.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.Example[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.Example) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExamples, request) + ); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listExamplesStream with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListExamplesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.Example[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.Example) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExamples, request) + ); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExamples without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListExamplesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Example() + ), + ]; + client.descriptors.page.listExamples.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datalabeling.v1beta1.IExample[] = []; + const iterable = client.listExamplesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listExamples.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExamples with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListExamplesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExamplesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datalabeling.v1beta1.IExample[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listExamples.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAnnotationSpecSets', () => { + it('invokes listAnnotationSpecSets without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + ]; + client.innerApiCalls.listAnnotationSpecSets = + stubSimpleCall(expectedResponse); + const [response] = await client.listAnnotationSpecSets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAnnotationSpecSets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotationSpecSets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnnotationSpecSets without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + ]; + client.innerApiCalls.listAnnotationSpecSets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAnnotationSpecSets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAnnotationSpecSets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotationSpecSets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnnotationSpecSets with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnnotationSpecSets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listAnnotationSpecSets(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listAnnotationSpecSets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotationSpecSets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnnotationSpecSetsStream without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + ]; + client.descriptors.page.listAnnotationSpecSets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAnnotationSpecSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listAnnotationSpecSets + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAnnotationSpecSets, request) + ); + assert( + ( + client.descriptors.page.listAnnotationSpecSets + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAnnotationSpecSetsStream with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnnotationSpecSets.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAnnotationSpecSetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listAnnotationSpecSets + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAnnotationSpecSets, request) + ); + assert( + ( + client.descriptors.page.listAnnotationSpecSets + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAnnotationSpecSets without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.AnnotationSpecSet() + ), + ]; + client.descriptors.page.listAnnotationSpecSets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet[] = + []; + const iterable = client.listAnnotationSpecSetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAnnotationSpecSets + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listAnnotationSpecSets + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAnnotationSpecSets with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnnotationSpecSets.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAnnotationSpecSetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datalabeling.v1beta1.IAnnotationSpecSet[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAnnotationSpecSets + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listAnnotationSpecSets + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstructions', () => { + it('invokes listInstructions without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListInstructionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListInstructionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + ]; + client.innerApiCalls.listInstructions = stubSimpleCall(expectedResponse); + const [response] = await client.listInstructions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstructions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstructions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstructions without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListInstructionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListInstructionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + ]; + client.innerApiCalls.listInstructions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstructions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.datalabeling.v1beta1.IInstruction[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstructions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstructions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstructions with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListInstructionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListInstructionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstructions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInstructions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInstructions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstructions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstructionsStream without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListInstructionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListInstructionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + ]; + client.descriptors.page.listInstructions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstructionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.Instruction[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.Instruction) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listInstructions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstructions, request) + ); + assert( + (client.descriptors.page.listInstructions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstructionsStream with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListInstructionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListInstructionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstructions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstructionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.Instruction[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.Instruction) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInstructions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstructions, request) + ); + assert( + (client.descriptors.page.listInstructions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstructions without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListInstructionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListInstructionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Instruction() + ), + ]; + client.descriptors.page.listInstructions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datalabeling.v1beta1.IInstruction[] = + []; + const iterable = client.listInstructionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstructions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstructions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstructions with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListInstructionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListInstructionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstructions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstructionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datalabeling.v1beta1.IInstruction[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstructions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstructions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchEvaluations', () => { + it('invokes searchEvaluations without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + ]; + client.innerApiCalls.searchEvaluations = stubSimpleCall(expectedResponse); + const [response] = await client.searchEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchEvaluations without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + ]; + client.innerApiCalls.searchEvaluations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchEvaluations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.datalabeling.v1beta1.IEvaluation[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchEvaluations with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchEvaluations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchEvaluations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.searchEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchEvaluationsStream without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + ]; + client.descriptors.page.searchEvaluations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.Evaluation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.Evaluation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.searchEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchEvaluations, request) + ); + assert( + (client.descriptors.page.searchEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchEvaluationsStream with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchEvaluations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.Evaluation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datalabeling.v1beta1.Evaluation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchEvaluations, request) + ); + assert( + (client.descriptors.page.searchEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchEvaluations without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.Evaluation() + ), + ]; + client.descriptors.page.searchEvaluations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datalabeling.v1beta1.IEvaluation[] = + []; + const iterable = client.searchEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.searchEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchEvaluations with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchEvaluations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datalabeling.v1beta1.IEvaluation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.searchEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchExampleComparisons', () => { + it('invokes searchExampleComparisons without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + ]; + client.innerApiCalls.searchExampleComparisons = + stubSimpleCall(expectedResponse); + const [response] = await client.searchExampleComparisons(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchExampleComparisons as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchExampleComparisons as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchExampleComparisons without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + ]; + client.innerApiCalls.searchExampleComparisons = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchExampleComparisons( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchExampleComparisons as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchExampleComparisons as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchExampleComparisons with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchExampleComparisons = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.searchExampleComparisons(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.searchExampleComparisons as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchExampleComparisons as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchExampleComparisonsStream without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + ]; + client.descriptors.page.searchExampleComparisons.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchExampleComparisonsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.searchExampleComparisons + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.searchExampleComparisons, request) + ); + assert( + ( + client.descriptors.page.searchExampleComparisons + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchExampleComparisonsStream with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchExampleComparisons.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchExampleComparisonsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.searchExampleComparisons + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.searchExampleComparisons, request) + ); + assert( + ( + client.descriptors.page.searchExampleComparisons + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchExampleComparisons without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison() + ), + ]; + client.descriptors.page.searchExampleComparisons.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison[] = + []; + const iterable = client.searchExampleComparisonsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchExampleComparisons + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.searchExampleComparisons + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchExampleComparisons with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchExampleComparisons.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchExampleComparisonsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.IExampleComparison[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchExampleComparisons + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.searchExampleComparisons + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEvaluationJobs', () => { + it('invokes listEvaluationJobs without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + ]; + client.innerApiCalls.listEvaluationJobs = + stubSimpleCall(expectedResponse); + const [response] = await client.listEvaluationJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEvaluationJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEvaluationJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationJobs without error using callback', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + ]; + client.innerApiCalls.listEvaluationJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvaluationJobs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.datalabeling.v1beta1.IEvaluationJob[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEvaluationJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEvaluationJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationJobs with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvaluationJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listEvaluationJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEvaluationJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEvaluationJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationJobsStream without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + ]; + client.descriptors.page.listEvaluationJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEvaluationJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.EvaluationJob[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.datalabeling.v1beta1.EvaluationJob + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listEvaluationJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEvaluationJobs, request) + ); + assert( + (client.descriptors.page.listEvaluationJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEvaluationJobsStream with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationJobs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listEvaluationJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datalabeling.v1beta1.EvaluationJob[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.datalabeling.v1beta1.EvaluationJob + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEvaluationJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEvaluationJobs, request) + ); + assert( + (client.descriptors.page.listEvaluationJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationJobs without error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.EvaluationJob() + ), + ]; + client.descriptors.page.listEvaluationJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datalabeling.v1beta1.IEvaluationJob[] = + []; + const iterable = client.listEvaluationJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEvaluationJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEvaluationJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationJobs with error', async () => { + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationJobs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEvaluationJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datalabeling.v1beta1.IEvaluationJob[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEvaluationJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEvaluationJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('annotatedDataset', () => { + const fakePath = '/rendered/path/annotatedDataset'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + annotated_dataset: 'annotatedDatasetValue', + }; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotatedDatasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotatedDatasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotatedDatasetPath', () => { + const result = client.annotatedDatasetPath( + 'projectValue', + 'datasetValue', + 'annotatedDatasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.annotatedDatasetPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotatedDatasetName', () => { + const result = client.matchProjectFromAnnotatedDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotatedDatasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotatedDatasetName', () => { + const result = client.matchDatasetFromAnnotatedDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotatedDatasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotatedDatasetFromAnnotatedDatasetName', () => { + const result = + client.matchAnnotatedDatasetFromAnnotatedDatasetName(fakePath); + assert.strictEqual(result, 'annotatedDatasetValue'); + assert( + (client.pathTemplates.annotatedDatasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('annotationSpecSet', () => { + const fakePath = '/rendered/path/annotationSpecSet'; + const expectedParameters = { + project: 'projectValue', + annotation_spec_set: 'annotationSpecSetValue', + }; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecSetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecSetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecSetPath', () => { + const result = client.annotationSpecSetPath( + 'projectValue', + 'annotationSpecSetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.annotationSpecSetPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecSetName', () => { + const result = client.matchProjectFromAnnotationSpecSetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.annotationSpecSetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecSetFromAnnotationSpecSetName', () => { + const result = + client.matchAnnotationSpecSetFromAnnotationSpecSetName(fakePath); + assert.strictEqual(result, 'annotationSpecSetValue'); + assert( + ( + client.pathTemplates.annotationSpecSetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataItem', () => { + const fakePath = '/rendered/path/dataItem'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + }; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath( + 'projectValue', + 'datasetValue', + 'dataItemValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + }; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath('projectValue', 'datasetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('evaluation', () => { + const fakePath = '/rendered/path/evaluation'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + evaluation: 'evaluationValue', + }; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.evaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.evaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('evaluationPath', () => { + const result = client.evaluationPath( + 'projectValue', + 'datasetValue', + 'evaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.evaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEvaluationName', () => { + const result = client.matchProjectFromEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromEvaluationName', () => { + const result = client.matchDatasetFromEvaluationName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromEvaluationName', () => { + const result = client.matchEvaluationFromEvaluationName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + (client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('evaluationJob', () => { + const fakePath = '/rendered/path/evaluationJob'; + const expectedParameters = { + project: 'projectValue', + evaluation_job: 'evaluationJobValue', + }; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.evaluationJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.evaluationJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('evaluationJobPath', () => { + const result = client.evaluationJobPath( + 'projectValue', + 'evaluationJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.evaluationJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEvaluationJobName', () => { + const result = client.matchProjectFromEvaluationJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.evaluationJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationJobFromEvaluationJobName', () => { + const result = client.matchEvaluationJobFromEvaluationJobName(fakePath); + assert.strictEqual(result, 'evaluationJobValue'); + assert( + (client.pathTemplates.evaluationJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('example', () => { + const fakePath = '/rendered/path/example'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + annotated_dataset: 'annotatedDatasetValue', + example: 'exampleValue', + }; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.examplePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.examplePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath( + 'projectValue', + 'datasetValue', + 'annotatedDatasetValue', + 'exampleValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromExampleName', () => { + const result = client.matchDatasetFromExampleName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotatedDatasetFromExampleName', () => { + const result = client.matchAnnotatedDatasetFromExampleName(fakePath); + assert.strictEqual(result, 'annotatedDatasetValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, 'exampleValue'); + assert( + (client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('instruction', () => { + const fakePath = '/rendered/path/instruction'; + const expectedParameters = { + project: 'projectValue', + instruction: 'instructionValue', + }; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instructionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instructionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instructionPath', () => { + const result = client.instructionPath( + 'projectValue', + 'instructionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instructionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstructionName', () => { + const result = client.matchProjectFromInstructionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instructionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstructionFromInstructionName', () => { + const result = client.matchInstructionFromInstructionName(fakePath); + assert.strictEqual(result, 'instructionValue'); + assert( + (client.pathTemplates.instructionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new datalabelingserviceModule.v1beta1.DataLabelingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-datalabeling/tsconfig.json b/packages/google-cloud-datalabeling/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-datalabeling/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-datalabeling/webpack.config.js b/packages/google-cloud-datalabeling/webpack.config.js new file mode 100644 index 00000000000..56374ab06e4 --- /dev/null +++ b/packages/google-cloud-datalabeling/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: 'datalabeling', + filename: './datalabeling.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 01e2a59ff97..18d9bf97291 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -15,6 +15,7 @@ "packages/google-cloud-bigquery-reservation": {}, "packages/google-cloud-certificatemanager": {}, "packages/google-cloud-contentwarehouse": {}, + "packages/google-cloud-datalabeling": {}, "packages/google-cloud-dataplex": {}, "packages/google-cloud-dataproc": {}, "packages/google-cloud-deploy": {},